Skip to main content

1. Intro

Before starting, I would like to give a special thanks to NetworkChuck for the excellent video on how to set up a Raspberry Pi cluster. This documentation page closely follows that video’s instructions, with some changes to reflect some of the updates that have been made to the Raspberry Pi Imager. Make sure to follow the steps in this guide for all your Raspberry Pis.

2. Pre-requisites

There is a single prerequisite for this guide:
This guide shows how to setup a Raspberry Pi 5 using Raspeberry Pi imager v1.8.5

3. Install OS

1

Choose Device

First, select your device. In this case, we are using a Raspberry Pi 5.rpi-select-device
2

Choose OS

Select Raspberry Pi OS Lite 64-bit as your headless OS.rpi-select-os
3

Choose your storage

Select the storage device where you want to install the operating system.rpi-select-os
4

Set Hostname, Username and Password

Under the General tab, set your hostname, username and password. The password you set here will be used when connecting to your node via SSH.
Tip: Use the same name for Username and Hostname for consistency.
rpi-set-hostname
5

Enable SSH

Enable SSH under the Services tab.rpi-enable-ssh
6

Save

Save the changes, and let the Imager set everything up.rpi-save-os
7

Boot up your Pi

Take the storage with the OS installed on it and connect to the Pi, power it up and allow it approximately 5 minutes to complete the boot process.

3. Enable Cgroups

As mentioned in the K3s docs, standard Raspberry Pi OS installations do not start with cgroups enabled. K3S requires cgroups to start the systemd service. The following steps will guide you through enabling cgroups on your Pi.
1

Reconnect the OS storage device to your computer

After letting your Pi boot for the first time, turn it off and reconnect the OS storage to your computer.
2

Open cmdline.txt

Open your OS storage device, navigate to and open the file named cmdline.txt.
3

Enable cgroups

Add the following code to the end of the file:
cgroup_memory=1 cgroup_enable=memory
You should end up with something like this:rpi-edit-dmlinetxtAfter that do not forget to save.
4

Boot up your pi (again)

After editing cmdline.txt, remove the storage device, connect it to the Pi, and power it up to reboot.

4. Setting a static IP

Now all that is left is to set a static IP to whatever we would like to have.
1

Connect to your Pi via SSH

Open the terminal and connect to your Pi using:
ssh <username>@<hostname>
2

Set the IP

To set a static IP, we define:
  • ipv4.addresses – The IP of this machine.
  • ipv4.gateway – The router or default gateway.
  • ipv4.dns – The DNS server to use (probably same as router).
  • ipv4.dns – Leave it manual.
Define these values and use them for the following command:
nmcli connection modify "Wired connection 1" \
ipv4.addresses <your_desired_ip>/24 \
ipv4.gateway <ip_of_router> \
ipv4.dns <ip_of_router> \ 
ipv4.method manual
3

Reboot Pi

For these changes to take effect we need to reboot our Pi.
reboot
You are done setting up your Raspberry Pis!