RASPBERRY PI GETTING STARTED SERIES

How To Setup SSH And Wifi In Headless Mode

In this lesson you will learn how to setup SSH using Wifi, SSH, and a remote computer connected to your Raspberry Pi in headless mode.

Now that you have Raspbian Lite on your SD Card, its time to do some simple configuration. The purpose of this configuration is:

    •    Enable the SSH deamon so that you can access your Raspberry Pi via the SSH protocol and your terminal emulator.
    •    Setup Wifi so that your Raspberry Pi can connect automatically to your local network once you start it for the first time.

The second item is very important because the Raspberry Pi Zero W does not have an Ethernet network interface. This means that you will not be able to access it without Wifi.

Also, because you are working in headless mode, you will not b/e able to plug in a monitor and a keyboard to setup Wifi directly.

Start by inserting your Raspberry Pi SD card into your computer. 

Use your computer’s file browser (Finder in Mac OS, Windows Explorer in Windows) to navigate to the disk with name “boot”. The Raspberry Pi looks inside this partition when it boots for special files that contain instructions like the ones we are about to create.

First, lets enable SSH. Use a text editor and create a new empty file. Save it to the boot disk with the file name “ssh”. No extension, and no content. Just an empty file named “ssh”, as in the screenshot below.

Create an empty text file titled “ssh” in the boot disk to enable SSH.

That’s it.

Let’s continue with the Wifi configuration.

Go to the project repository on Github, and grab a copy of the wpa_supplicant.conf.buster file. It looks like this:

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="---your-SSID--"
    psk="---your-wifi-passkey---"
}

Use your favourite text editor to create a new text file, and copy the content from the sample supplicant file in it. Take care to type in the correct network name and password in the “ssid” and “psk” fields.

Then, save the file to the “boot” disk with the name ”wpa_supplicant.conf”:

The wpa-supplicant.conf file in the boot disk configures the Wifi interface before the first boot.

When you have both the “ssh” and “wpa_supplicant.conf” files saved in the boot disk, you can eject it from your computer.

In the next lesson, you will use it to boot your Raspberry Pi for the first time.

Ready for some serious learning?

Start right now with Raspberry Pi Full Stack - Raspbian

This is our most popular Raspberry Pi course & eBook.


This course is a hands-on project designed to teach you how to build an Internet-of-Things application based on the world’s most popular embedded computer.


You will learn how to build this application from the ground up, and gain experience and knowledge with technologies such as...


  • The Linux operating system and the command line, 
  • The Python programming language,
  • The Raspberry Pi General Purpose Input Output pins (GPIOs), 
  • The Nginx web server,
  • The Flask Python web application microframework,
  • JQuery and CSS for creating user interfaces,
  • How to deal with timezones, 
  • How to create charts with Plotly and Google Charts, 
  • How to do datalogging with Google Sheet, 
  • How to create applets with IFTTT,
  • How to secure your application with SSL.
  • Last Updated 9 months ago.

    We publish fresh content each week. Read how-to's on Arduino, ESP32, KiCad, Node-RED, drones and more. Listen to interviews. Learn about new tech with our comprehensive reviews. Get discount offers for our courses and books. Interact with our community. One email per week, no spam; unsubscribe at any time

    {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}