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


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.

  ssid="your network name"
  psk="your network password"