Skip to content

Quickstart guide for Raspberry Pi OS headless installation

Assuming you already have the latest Raspberry Pi OS image downloaded, flash the image to your SD card. /dev/sdc is the SD card on my machine, double check this on your system, if you get this wrong you could overwrite your hard drive.

sudo dd if=/home/laurence/Downloads/2024-07-04-raspios-bookworm-armhf-lite.img of=/dev/sdc bs=512 status=progress

Remove and reinsert the SD card, your OS should mount the bootfs partition. On my system this is mounted at /run/media/laurence/bootfs.

Enable SSH on boot

To enable the SSH server on boot, create an empty file called ssh in the bootfs partition.

touch ssh

Add a user to Raspberry Pi OS

As of bookwork, the pi user is no longer created by default. You will need to create a new user when you first boot the OS.

In the bootfs partition, create user-data file with this command, replacing rpiuser with your desired username.

echo rpiuser:$(echo 'Marvin42' | openssl passwd -6 -stdin) > user-data

Now boot the Raspberry Pi with the SD card, and connect to the Pi via SSH with username and password you set in the user-data file.