Setting Up the Raspberry Pi Zero W as a Headless Server

The other day I was fortunate enough to be able to purchase a Raspberry Pi Zero W from Adafruit. You can’t beat a fully functioning $10 wireless computer. I, of course, wanted to setup the Zero W as a headless server but I couldn’t directly plug it into my network due to the lack of an Ethernet port.

Luckily I found a post that gives directions on how to setup the RPi Zero W to automatically connect to a wireless network.

After installing a fresh Raspbian image on an SD card, mount the root partition (not the boot partition) by using a fuse-ext2 on a Mac or another Linux distribution.

Open the network interfaces file for editing.

$ sudo nano /etc/network/interfaces

Modify the following section from

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

to

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Next, edit the wpa_supplicant.conf file.

$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Add your network information to the end of the file.

network={
  ssid="your network name"
  psk="your network password"
  proto=RSN
  key_mgmt=WPA-PSK
  pairwise=CCMP
  auth_alg=OPEN
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s