If you burned the OS image successfully, you should see a folder named boot appear on your main computer. If it doesn't, try removing and reinserting the SD card. If it still doesn't, try burning the image again.

There are three text files we will create/edit in boot.

  1. wpa_supplicant.conf - wifi settings
  2. config.txt - global system settings
  3. ssh - an empty text file to enable ssh

We are going to edit these directly on the SD card before putting it in the Pi Zero. This way you can edit these files using your favorite text editor on your main computer. Try to avoid using a word processor though. A "text editor" edits text and nothing else, whereas a "word processor" allows for all kinds of formatting, like making text bold, inserting images, etc. 

Configure WiFi

The Pi Zero W has built in WiFi so nothing additional is required. WiFi is only supported on 2.4 GHz band. If you are using the original Pi Zero, you will need some form of WiFi Adapter and a way to connect it: cable or adapter.

The WiFi configuration file does not exist and needs to be created. The name of the file should be wpa_supplicant.conf and its contents will get copied to the system folder at boot time. It will then be deleted. So this a one time only process. If you want to try again, you have to recreate the file and reboot.

The contents of the file should be as shown below. Replace YOURSSID and YOURPASSWORD with whatever is used for your network setup.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

Don't put any spaces around the = in this file. It doesn't like that.

Like this:

Save file and move on to next step. (more details here)

Enable UART

The file called config.txt already exists, we are just going to edit its contents. We will add some text to the bottom to enable the UART on the GPIO header pins. This allows a USB console cable to be attached later for troubleshooting.

Open the file in a text editor and add the following text to the bottom.

# Enable UART

Like this:

Save it and move on to next step. (more details here)

Enable SSH

SSH used to be enabled by default, but was then (Nov 2016) turned off by default. This was due to security concerns since the pi user id and password are well known. However, you'll likely want this enabled so you can remotely connect to the Pi Zero.

To do so, we simply create a file called ssh. This file does not exist and needs to be created. It can be empty. The system looks for it at boot time and will enable ssh if it is there. It is then deleted. So just create a new file and save it as ssh to the boot folder.

Final Check

After the above steps, you should have the following files on the SD card in the boot folder.

Safely remove the SD card from the main computer and install it in the Pi Zero.

This guide was first published on May 17, 2017. It was last updated on 2021-09-03 12:47:41 -0400.

This page (Text File Editing) was last updated on Aug 19, 2022.

Text editor powered by tinymce.