If you’d like to setup your Raspberry Pi headless - without a monitor (the missing "head"), keyboard, and mouse - look no further. This step-by-step guide will walk you through it - assuming a few things: you have a Raspberry Pi 3 Model B, a microSD card and are reading this on a Mac.
Burn Raspian onto microSD card#
- Download the latest Raspian with Desktop image (currently, that’s Raspian Buster version: February 2020)
- Expand the
2020-02-13-raspbian-buster.img
file from2020-02-13-raspbian-buster.zip
- Flash the microSD card with balenaEtcher
Configure for headless operation#
- Enable Secure Shell (SSH) by adding an empty file
ssh
, without any extension, onto the microSD card’s boot partition$ touch /Volumes/boot/ssh
- Configure WiFi by adding a file
wpa_supplicant.conf
onto the SD card’s boot partition$ touch /Volumes/boot/wpa_supplicant.conf
and add the following lines (don’t forget to replaceYOUR_WIFI_SSID
andYOUR_WIFI_PASSWORD
):
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="YOUR_WIFI_SSID"
psk="YOUR_WIFI_PASSWORD"
}
Connect via SSH#
- Insert the microSD card into your Raspberry Pi and power it up
- Get the local network IP address of your Raspberry Pi
$ ping raspberrypi
- Connect via SSH
$ ssh pi@<YOUR_PI_IP_ADDRESS>
(default password for thepi
user israspberry
)
If you have been reinstalling Raspian and are using the same IP address, you will most likely get a WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
message. When you establish a new SSH connection, a fingerprint is created and cached on your local machine. Remove the cached key for the IP address $ ssh-keygen -R <YOUR_PI_IP_ADDRESS>
and try again to connect via SSH.
Connect via VNC#
- Connect to your Raspberry Pi via SSH
- Run
$ sudo raspi-config
, open Interfacing Options and enable VNC - Download VNC Viewer and connect via Virtual Network Computing (VNC)
Some housekeeping#
- Upate and upgrade Raspian running:
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get clean