Home Interests Raspberry Pi

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

howchoo   (467)
September 9, 2023
9 minutes

Share

You'll Need 4

What you'll need
Interests
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.
Posted in these interests:
pi • 92 guides

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.

1 – Install Raspberry Pi OS on the SD card

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.

How to Install Raspberry Pi OS on Your Raspberry Pi
Get the new official Raspberry Pi OS on your Pi.

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.

2 – Enable SSH

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.

How to Enable SSH on Raspberry Pi OS Without a Screen
The SSH protocol is disabled by default.

3 – Enable WiFi

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.

4 – Unmount the SD card and boot the Raspberry Pi

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.

5 – Find the IP address of the Pi

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.

6 – SSH into the Pi

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

ssh [email protected]

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

7 – (Optional) Mount the Raspberry Pi onto your computer

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 [email protected]:/ /Volumes/pi
NEXT UP

How to Run a Minecraft Server on the Raspberry Pi

A whole world trapped inside your Pi.
howchoo   (467)
December 7, 2023

There are several ways to go about running a Minecraft server on the Raspberry Pi. In this guide, I’ll cover how to install Nukkit—a cross-platform Minecraft server that’s super easy to set up on the Raspberry Pi. This server should work with PCs, consoles, and tablets running Minecraft 1.14. I’ll be using a Raspberry Pi

Continue Reading

howchoo

 467 guides

Introducing Howchoo, an enigmatic author whose unique pen name reflects their boundless curiosity and limitless creativity. Mysterious and multifaceted, Howchoo has emerged as a captivating storyteller, leaving readers mesmerized by the uncharted realms they craft with their words. With an insatiable appetite for knowledge and a love for exploration, Howchoo's writing transcends conventional genres, blurring the lines between fantasy, science fiction, and the surreal. Their narratives are a kaleidoscope of ideas, weaving together intricate plots, unforgettable characters, and thought-provoking themes that challenge the boundaries of imagination.

Discover interesting things!

Explore Howchoo's most popular interests.

Explore