Introduction: Installing GitLab Runner on Ubuntu ARM

GitLab Runner is an open-source project that runs CI/CD pipelines with GitLab. This comprehensive guide will walk you through installing GitLab Runner on an Ubuntu ARM system. ARM architecture is commonly used in devices such as Raspberry Pi, making it essential to know how to set up GitLab Runner on these platforms.

System Preparation and Updates

Before starting the installation process, it’s crucial to ensure your system is up to date. Open your terminal and run the following commands:

sudo apt-get update

sudo apt-get upgrade

This will update your package lists and upgrade all your packages to the latest versions.

Adding the GitLab Runner Repository to Your System

To install GitLab Runner, we first need to add the GitLab Runner repository to our system:

curl -fsSL https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash

This script automatically detects your operating system and architecture, adding the appropriate repository.

Installing the GitLab Runner Package

With the repository added, you can now install the GitLab Runner package using the following command:

sudo apt-get install gitlab-runner

Obtaining the ARM-Compatible GitLab Runner Binary

Since we are working on an ARM-based system, we need to download the ARM-compatible GitLab Runner binary. Use the following commands to download and install it:

sudo mkdir -p /etc/gitlab-runner

curl -L –output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-arm

sudo chmod +x /usr/local/bin/gitlab-runner

Setting Up Proper Permissions

Ensure that the GitLab Runner binary has the necessary permissions to execute:

sudo chmod +x /usr/local/bin/gitlab-runner

Registering Your GitLab Runner

Before starting the GitLab Runner service, register your runner with your GitLab instance. Execute the following command and follow the prompts:

sudo gitlab-runner register

You will be prompted to enter your GitLab instance URL, registration token, and other configuration details.

Initiating the GitLab Runner Service

Once the runner is registered, start the GitLab Runner service:

sudo gitlab-runner start

Configuring GitLab Runner to Start Automatically at Boot

To ensure that the GitLab Runner service starts automatically at boot, use the following command:

sudo systemctl enable gitlab-runner

Final Verification and Testing

To verify that your GitLab Runner is installed and functioning correctly, run the following:

sudo gitlab-runner verify

This command will check the status of your GitLab Runner and confirm that it is correctly registered and running.

Conclusion

Following this guide, you have successfully installed and configured GitLab Runner on an Ubuntu ARM system. This setup enables you to run CI/CD pipelines efficiently on ARM-based devices, expanding your development capabilities.

References

Deploy and Manage Gitlab Runners on Amazon EC2

Unlock the power of EC2 Graviton with GitLab CI/CD and EKS Runners