Setting up a Headless Raspberry Pi


Our goal is to set up a Raspberry Pi to be headless, or without a monitor, that we can connect to through SSH. This will be very useful for setting up Raspberry Pi Zero W boards because these use mini HDMI for display out, and you need a USB-OTG adapter to connect a mouse and keyboard. You can set up any Raspberry Pi board in this way.

I am using Windows to set this up, but these steps are straightforward enough that you can do it on Mac or Linux.


  1. Raspberry Pi that can connect to the internet (using built-in Wi-Fi or a dongle)
  2. Good quality SD card
  3. Micro-USB power supply for powering the board

Software Used:

  1. PuTTY (or another SSH client). PuTTY
  2. Win32 Disk Imager

Step 1:

The first step is to download the operating system the Raspberry Pi will use, I chose to use Raspbian, the official Raspberry Pi operating system. You could use another operating system, but the steps to set up SSH may be slightly different. Get Raspbian. Since we are setting up our Pi to work headless, we can choose the "lite" version of whatever operating system because we do not need the desktop features. This saves space on our SD card, too.

Step 2:

Next, use Win32 Disk Imager to write the operating system to the SD card.

Windows thirty two disk imager.

Select the downloaded operating system image with the blue folder icon.

Make sure the correct drive is selected!

Click "Write" to write the operating system to the SD card. This will take a while.

Step 3:

Next, we need to create two files that will let us connect to WiFi and use SSH on the Raspberry Pi. To improve security of connected devices, your Raspberry Pi operating system will most likely have SSH disabled by default.

You may need to eject your card and re-insert it into your PC to find the /boot directory.

Start by making a notepad file with the lines:

                    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
                        ssid="<Name of your WiFi>"
                        psk="<Password for your WiFi>"

Save this file as "wpa_supplicant.conf" in the /boot directory.

Rasbian needs an empty, extensionless file named " ssh. " in the /boot directory of the SD card to enable SSH. To do this on Windows, open Notepad and save a blank file with the name " ssh. " and choose All Files for the Save as type. Move this file to the /boot directory. note: the " . " at the end of ssh is important when saving the SSH file otherwise Windows will make this a text file, even if we choose All Files for the Save as type.

Congratulations, you are now ready to plug in your Raspberry Pi!

Step 4:

Now we will plug in the Raspberry Pi to a power supply. While the Raspberry Pi boots for the first time, we need to find the IP address of the Pi. There are many ways to do this, I logged into my home router to look at the connected devices because this was easiest for me to do.

This is what I see when I look into connected devices on my home router.

What we are looking for is the IP Address so we know what to SSH to later.

Here, my Raspberry Pi's address is

Router connected devices.

Step 5:

The next step is to open our SSH client and attempt to log into the Pi.

This is the main screen of PuTTY. All we need to do to connect to the Pi is put the IP address.

If you want to save the IP address to connect easily in the future, enter a name for the connection in the Saved Sessions box and click Save.

In the future, we can open a connection to this IP address by double-clicking the saved session name.

Putty main screen.

If you see this, congratuations! You have now connected to your Raspberry Pi over SSH.

The next steps are to change the default password and set a static IP address.

The default login for the Raspberry Pi is user: pi, password: raspberry

Blank login screen.

Step 6:

The next step is to change the default password for the Raspberry Pi. This is important to do because anyone on your network could log in to the Raspberry Pi.

To change the password, use the command passwd and follow the prompts.

Change the password.