I'm planning to maybe install Ubuntu server on an old machine. But my question is: can I install Ubuntu server on a machine and have it connect to my home network - wirelessly? I can't use a cable in this case.


You can install a GUI interface to Ubuntu server to get Network Manager or following the wpa_supplicant on this page (https://help.ubuntu.com/community/WifiDocs/WPAHowTo).

|improve this answer|||||
  • Does that wpa_supplicant require a graphical interface too? – Lyrositor Oct 20 '10 at 22:09
  • 2
    wpa_supplicant can be configured from the command line. – Mike Oct 20 '10 at 22:10
  • NetworkManager can work without a GUI too... – JanC Oct 21 '10 at 2:26

Note: First off you will want to make sure that the server has wpa_supplicant installed. Servers don't always have it and that can make it difficult if you can't connect it to Ethernet at least once.

This is how I do it. (be sure to use your ip numbers and network interface name)

Wont need this part for a server it is just if you wanted to kill off everything that would be interfering on a desktop.

sudo stop network-manager
sudo killall wpa_supplicant #must stop network-manager before this as it resurrects it.
sudo killall nm-applet

this only needs to be done once unless the file gets trashed. (you can put the config anywhere really)

wpa_passphrase "YOUR_ESSID" | sudo tee /etc/wpa_supplicant.conf #and type your password

-B for background -s to log to syslog -c to tell it where the config is. -i interface

sudo wpa_supplicant -B -s -c /etc/wpa_supplicant.conf -i wlan0

for DHCP just use

sudo dhclient wlan0

for static ip

sudo ifconfig wlan0 #Be sure to set you ip to what works for you.

should be able to ping your router by ip. $ ping

sudo route add default gw # use the ip of you router

should be able to ping the net at large. $ ping

echo "nameserver" | sudo tee /etc/resolv.conf

should be done. $ ping google.com

This will not last through a reboot. To make this persist through a reboot,

sudo nano /etc/network/interfaces

Add this to the bottom (substitute for wlan0 if you have a different interface):

auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -B -c /etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant

Note that you might not have the KILLALL component installed if you have a minimal server. You can get killall with:

aptitude install psmisc
|improve this answer|||||
  • Above answer is near-perfect, although I had to add a "-i wlan0" to the pre-up line which calls wpa_supplicant. (This matches the example given further up the answer.) – Gervase Markham Sep 7 '14 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.