Headless installation of RaspberryPiOS

Saturday, February 4, 2023


Since I broke my PiHole previous installation, I had to reintall it from scratch on a the RaspberryPi 0W I’m using for it. This is more like a short note for myself, since the process has changed a bit since my last post on it. For more details, read the official headless installation documentation.

First, download the latest image and install it on an SD Card (decompress the image with unxz):

sudo dd if=/path/to/image.img of=/dev/mmcblk0 conv=fsync status=progress

To enable ssh, create a file named ssh in the boot partition, eg:

touch /media/bacardi55/boot/ssh

To create a user automatically, it now requires a userconf.txt in the boot partition. The file needs to have a single line in the format username:encryptedPassword.

To encrypt the password you want to use:

openssl passwd -6

And then type your password. Example with test as a password:


So the userconf.txt file would look like this with the user test and password test:


If wireless network needs to be configured before first boot, edit the /etc/wpa_supplicant.conf file as usual. In my case, the Pi0W uses a wired connection and the IP is fixed by the router.

Then I just add to follow again the PiHole documentation.


If you find any issue or have any question about this article, feel free to reach out to me via email, mastodon, matrix or even IRC, see the About Me page for details.

See Also

Setting up OpenPGP Web Key Directory (WKD)

New laptop part 3: i3wm configuration