Debian on a Raspberry Pi 4

· Coffee and Computers

Setting up a Raspberry Pi 4 with Debian

Debian #

Typically, when setting up a new Raspberry Pi you will reach for Raspberry Pi OS (previously called Raspbian). Since I prefer to trim down my OS as much as possible and build from there, I reach for the (semi-official) Debian images for Pis. This is great because it allows me to skip the installer step and automate the bootstrap process.

The steps for this have been performed on macOS, but the commands should translate to any Unix system.

Download a Debian Raspberry Pi Image #

1curl -O -L "https://raspi.debian.net/tested/20230102_raspi_4_bullseye.img.xz"

Flash the SD Card #

Once the SD card is plugged into the laptop, confirm the disk number assigned to this device (e.g. /dev/disk2).

1xzcat 20210823_raspi_4_bullseye.img.xz | sudo dd of=/dev/disk4 bs=64k

Update Image Configuration #

1vim /Volumes/RASPIFIRM/sysconf.txt
2# Uncomment and update the root_autherized_key value (e.g. pbcopy < ~/.ssh/id_ed25519.pub).
3# Uncomment and update the hostname value (e.g. controller-0).

Unmount the SD Card and Repeat #

1sudo diskutil unmount /Volumes/RASPIFIRM

Repeat this process for all Raspberry Pis.