How to Set up Your Raspberry Pi Without a Keyboard, Monitor, or Mouse

John John (304)
5 minutes

If you don't have an extra keyboard and monitor laying around, or if you generally prefer working on the command line, then you'll benefit from a headless Raspberry Pi setup. In this case, headless simply means that we'll set up and use the Raspberry Pi without any monitor or other GUI. This guide will walk you through the process of setting up a headless Raspberry Pi.

I recommend using a Raspberry Pi 3/4 or Raspberry PI Zero W since they have onboard WiFi. If you're using a different version of the Pi, you'll need to add a Raspberry Pi WiFi USB adapter.

In addition to the Pi, you'll need a power supply, SD card, and another computer.

Raspberry PiRaspberry Pi ×1
Personal Computer ×1
Raspberry Pi power supply, 2A ×1
MicroSD card, 32GB ×1

Howchoo is reader-supported. As an Amazon Associate, we may earn a small affiliate commission at no cost to you when you buy through our links.

We've written a detailed guide on how to install Raspberry Pi OS on your Raspberry Pi. Follow this guide to get the latest version of Raspberry Pi OS on your SD card.

After installing Raspberry Pi OS on the card, leave the SD card in your computer. We'll do much of the remaining setup from here.

To enable SSH, first navigate to the boot directory:

cd /Volumes/boot

Now create an empty file called "ssh":

touch ssh

This will enable SSH when the Pi is booted. If you need more details on this process, view the full guide to enable SSH on Raspberry Pi OS without a screen.

In order to SSH into your Pi, you'll need to be connected to your local network. You can, of course, use Ethernet, but if you're using the Raspberry Pi 3, you've got WiFi built-in. So let's add our WiFi configuration to the Pi so it's available when we boot.

Navigate to the boot directory:

cd /Volumes/boot

And create a file called wpa_supplicant.conf. Add the following to this file:

For Raspbian Jessie:

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

For Raspbian Buster or Stretch:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
    ssid="YOUR_NETWORK_NAME"
    psk="YOUR_PASSWORD"
    key_mgmt=WPA-PSK
}

You'll need to add your wireless network name and password.

Again, if you need more details on this process view the full guide on how to set up WiFi on your Raspberry Pi without Ethernet.

At this point, you can access the Raspberry Pi via SSH. Remove the SD card from your computer, then put it in the Pi and boot.

Now we'll need to find the IP address of the Pi. If you've only got one Pi on your local network, this is easy. Simply use ping.

ping raspberrypi

If you've got multiple pi's, you may need to scan the network with nmap and locate your Pi.

nmap -sn 192.168.1.0/24

You'll need to make sure you're using the correct subnet. Then find the address of your Pi in the output. For more information see the full guide on finding the IP address of your Raspberry Pi.

With the IP address located, you can SSH into the Pi using:

ssh pi@192.168.1.183

Of course, you'll need to substitute your IP address.

This is not a necessary step, but for many it's preferable to mount the Pi's filesystem locally rather than work directly on the Pi. We'll use sshfs to create the mount, so first install sshfs.

Now create the directory where you'll place the mount. I'm going to use /Volumes/pi.

sudo mkdir /Volumes/pi

Now create the mount.

sudo sshfs -o allow_other pi@192.168.1.183:/ /Volumes/pi
Ben Ben (11)
20 minutes

Laptops, smartphones, tablets, even lightbulbs—an endless number of devices now have the ability to connect to your local network and the wider internet.