How to setup WiFi and SSH on a Raspberry Pi Zero W without a monitor or a keyboard?

The Raspberry Pi Zero needs a USB adapter and an HDMI adapter in order to use it with your HDMI monitor or TV and to connect a USB standard keyboard or mouse.

That’s why this tutorial is kind of handy because you can configure this tiny device without the needs to buy extra adapters to make them work.

Requirements

1. Insert the SD card with Raspbian installed into your computer.

If you don’t have Raspbian installed, please visit the official raspberry pi website at www.raspberrypi.org and click Downloads.  Follow the instructions and come back once you have Raspbian installed.

2. Open terminal if you are using a Mac and navigate to the boot directory.

Enter the following command and press enter.

cd /Volumes/boot

Next, create a new file and edit it using your favorite text editor. In this tutorial, I’m using TextMate but you can use anything you want.

Enter the following command and press enter.

touch wpa_supplicant.conf

To find the new file you just created, you can use the following command to open finder and land in side the /Volumes/boot folder.

open .

Now, edit the wpa_supplicant.conf using your text editor and enter the following code:

For Raspbian Stretch:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
    ssid="YOUR_NETWORK_NAME"
    psk="YOUR_PASSWORD"
}

For Raspbian Jessey

network={
    ssid="YOUR_NETWORK_NAME"
    psk="YOUR_PASSWORD"
    key_mgmt=WPA-PSK
}

Raspbian will move this file to “/etc/wpa_supplicant/” the first time the Raspberry Pi boot up.

Done

Insert the SD card to your Raspberry Pi and boot it up. You might need to use a network scan software to find out the IP address that your network DNS assigned to the pi.  I use a free software on the mac called LanScan

LanScan Software

If you have any questions, please leave me a comment below and I will do my best to get back to you as soon as possible.