How I Set Up GitLab Runner on My Raspberry Pi 4 (And You Can Too)

Created at 2025-01-07 Updated at 2025-02-07 - 3 min. read Tag gitlab, rpi

How I Set Up GitLab Runner on My Raspberry Pi 4 (And You Can Too!)

I was setting up GitLab Runner on my DigitalOcean (DO) instance when it suddenly hit me—I have a Raspberry Pi 4 just sitting there! Why not put it to good use?

If you’re like me and love tinkering with tech, you’ll be happy to know that setting up GitLab Runner on an RPi is totally doable. There are three major ways to install GitLab Runner:

  • Shell
  • Docker
  • Kubernetes

At first, I went with Docker since RPi supports it now, but I ran into a snag—there was no ARM64 image for GitLab Runner. So, I had to pivot and go with the shell installation instead. Let me walk you through the process!


Step 1: Install Git

First things first, let’s install Git. It’s a simple one-liner:

1
sudo apt install git

Step 2: Install Docker

Docker is great for managing containers, so let’s get it installed on our RPi:

1
2
3
4
5
6
7
8
9
10
11
12
# Download script and start installation
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

# Add the current user to the Docker group
sudo groupadd docker

# This command might return an error if the group already exists
sudo usermod -aG docker ${USER}

# List all groups the current user belongs to
groups ${USER}

Step 3: Install GitLab Runner

Now, let’s install GitLab Runner itself.

First, check the current OS version:

1
cat /etc/os-release

Next, set up the repository and install GitLab Runner:

1
2
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo os=debian dist=bullseye bash
sudo apt install gitlab-runner

Step 4: Register the Runner

Now comes the fun part—registering the runner! Get the token from your GitLab group runner and run:

1
sudo gitlab-runner register

When prompted, enter docker as the executor.

Step 5: Configure the Runner for Docker-in-Docker (DinD)

If you want your runner to support Docker-in-Docker (DinD), add this configuration:

1
2
3
4
5
6
7
8
9
[runners.docker]
tls_verify = false
image = "juggernaut451/docker-dind:latest"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache","/var/run/docker.sock:/var/run/docker.sock"]
shm_size = 0

🎉 GitLab Runner is Now Ready! 🎉

And that’s it! You now have a fully functional GitLab Runner on your Raspberry Pi. Whether you’re automating builds, running CI/CD pipelines, or just experimenting, this setup will serve you well.

Have any questions or ran into an issue? Drop a comment below, and let’s troubleshoot together! 🚀

Site by Ashutosh Kumar Singh using Hexo & Random

Traveller - Developer - Foodie - Biker - Cyclist - Rider - Technocrat