-
Flash the latest Raspberry Pi alpine linux image to the SD CARD. See Alpine's Documentation for details
-
Remount the sd hard on your computer (as you'll be adding some additional files to it before the SD card is inserted into your Raspberry Pi)
-
Download the
headless.apkovl.tar.gz
file from the alpine-linux-headless-bootstrap repo and add it to the to the root folder of the mounted sd card (e.g. the FAT partition).Note: You don't need to extract the
headless.apkovl.tar.gz
file, just place it there (there is a magic service which will execute it on boot) -
Add some additional files like
authorized_keys
to the base folder of the FAT partition of the SD Card to enable ssh access to the device after bootFor example, the
authorized_keys
keys file with your public SSH key (but this would give me access to your device, so please change it!)ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDxm81BGp+bQfMM0jgoMmUD7nXpBCclEq+NqVxUf5D65
You can also add other files such as Wifi credentials. All of the instructions on how to do this are detailed in the alpine-linux-headless-bootstrap repo
-
Put the SD Card into your Raspberry Pi Device, and boot it up
-
Connect via SSH
ssh root@<device_ip_address>
e.g.
-
Run the
setup-alpine
script (provided by Alpine)setup-alpine
You will be prompted for a lot of entries, but try to configure the repositories if you can.
-
Reboot after the setup has completed
-
SSH into the device again (after the machine has rebooted)
Note: You will need to remove the server from your host's
$HOME/.ssh/known_hosts
as the SSH server will have changed in the meantime! -
Edit the apk repository to enable the community repository (it is usually commented out at the top)
vi /etc/apk/repositories
Example:
http://dl-cdn.alpinelinux.org/alpine/v3.21/community
-
Install some base dependencies that thin-edge.io installer will need
apk add curl bash sudo
-
Install thin-edge.io
wget -O - thin-edge.io/install.sh | sh -s
-
Optional: Install podman and other dependencies like cgroups
apk add cgroup-tools podman podman-compose fuse-overlayfs rc-update add podman sed -i 's/#mount_program/mount_program/' /etc/containers/storage.conf sed -i 's/.*rc_cgroup_mode=.*/rc_cgroup_mode="unified"/g' /etc/rc.conf
Then reboot the device
reboot
-
Check that podman is operational
podman run --rm -it alpine:3.21 sh
This should bring you to a terminal within the container without any errors.
-
Install some other useful thin-edge.io plugins
apk add tedge-command-plugin tedge-container-plugin-ng
If sudo
isn't installed at the time that thin-edge.io is installed, then you will need to add the sudoers rules.
echo "tedge ALL = (ALL) NOPASSWD: /usr/bin/tedge, /etc/tedge/sm-plugins/[a-zA-Z0-9]*, /bin/sync, /sbin/init" > /etc/sudoers.d/tedge
echo "tedge ALL = (ALL) NOPASSWD: /usr/bin/tedge-write /etc/*" >> /etc/sudoers.d/tedge
echo "tedge ALL = (ALL) NOPASSWD: /usr/bin/tedgectl" > /etc/sudoers.d/100-tedge-tedgectl
Just a very small addition, I also added the /usr/bin/tedgectl into the first line here. It solved the failed restart device problem.


It's now like this: