Barebones set-up of a headless RPi

Posted on 2020-03-26 by waalge

A semi-regular event: setting up a RPi from scratch.

This is a super short setup guide.

Flashing

Download an image as a zip and extract, and do a checksum to ensure download correct.

Burn image to sd card. For example, if:

  • the image file is 2020-02-13-raspbian-buster-lite.img
  • the location of sd card is /dev/mmcblk0 (use, for example, lsblk)
sudo dd bs=1M if=2020-02-13-raspbian-buster-lite.img of=/dev/mmcblk0

Configuring

I think I’ve successfully configured a new flash to run a headless RPi with a single attempt once. Every other time it’s a lot of staring at blinking lights and blank terminals. Rightly or wrongly, I often blame exotic wifi configurations (or secret trailing whitespace in their SSID …)

There are various ways to do this: wifi, ethernet direct to laptop, or with the zero over USB. This time I tried, failed, and went to dig out a monitor and keyboard. Far easier setting up and confirming wifi and ssh setting via raspi-config.

Since I failed to do this, I’ll just point at the instructions.

Add a public ssh key to ~/.ssh/authorized_keys and add the RPis details into the local machine’s ssh ~/.ssh/config.

Updating

On the RPi, update and upgrade

sudo apt update; sudo apt upgrade

Install all the favs you definitely will use

sudo apt install git vim python3-dev python3-pip