Manual Installation of GitLab Runner on Raspberry Pi (Linux ARM64)
This guide provides step-by-step instructions for manually installing GitLab Runner on a Raspberry Pi device running Linux ARM64. This method is particularly useful for setups that require a custom installation process or for environments where the automated installers are not applicable.
Prerequisites
- A Raspberry Pi device with Linux ARM64 installed.
- Terminal access to the Raspberry Pi.
- Internet connection on the Raspberry Pi.
- Sudo privileges on the Raspberry Pi.
Step 1: Download GitLab Runner
First, download the GitLab Runner binary for Linux ARM64. Use the following command to download it directly to the appropriate directory:
sudo curl -L --output /usr/local/bin/gitlab-runner "https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/binaries/gitlab-runner-linux-arm64"
Step 2: Give Execution Permissions
After downloading, you need to give execution permissions to the GitLab Runner binary:
sudo chmod +x /usr/local/bin/gitlab-runner
Step 3: Create a GitLab Runner User
For security reasons, it’s recommended to run GitLab Runner under a separate user. You can create a new user specifically for GitLab Runner:
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
Step 4: Install and Run as a Service
To ensure GitLab Runner starts on boot and runs in the background, install it as a system service:
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start
Step 5: Register the Runner
With GitLab Runner installed, the next step is to register it with your GitLab instance. You’ll need a registration token from your GitLab project (Settings > CI/CD > Runners):
sudo gitlab-runner register --url https://gitlab.com/ --registration-token YOUR_REGISTRATION_TOKEN
During registration, follow the prompts to configure your Runner, including specifying the executor (e.g., Docker, Shell).
Step 6: Verify Installation
After registration, verify that GitLab Runner is running correctly:
sudo gitlab-runner status
Testing Auto-Start on Reboot
To ensure that GitLab Runner starts automatically after a reboot, you can restart your Raspberry Pi and check the Runner’s status:
sudo reboot
# After rebooting
sudo gitlab-runner status
Conclusion
You’ve successfully manually installed GitLab Runner on your Raspberry Pi (Linux ARM64). This setup allows you to leverage your Raspberry Pi for CI/CD operations, automating your development workflows.
For more detailed information and troubleshooting, refer to the official GitLab Runner documentation.