If you’re setting up a CI/CD pipeline with GitLab, its an essential step to install and register GitLab Runner. GitLab Runner is an open-source project used to run your jobs and send the results back to GitLab.
- Install GitLab Runner from the official repository
- Registering the runner using the SSH executor
- Configuring the runner for secure, remote job execution
Prerequisites
- A GitLab account with access to a project or group
- A machine (VM or server) where the runner will be installed
- A runner registration token (available via GitLab UI)
- SSH access to the remote machine if using the SSH executor
1: Add the Official GitLab Repository
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash
2: Install GitLab Runner
sudo apt install gitlab-runner
3: Verify Installation
Run the following command to confirm installation:
gitlab-runner --version
Installing GitLab Runner using GitLab’s official repositories ensures you always get the latest, secure, and compatible version.
Register A Runner
Prerequisites
You need a runner authentication token.
You can find it by:
- Creating a new runner (Instance/Group/Project level).
- Or checking an existing config.toml for the token.
Register the Runner
Open your terminal and run:
sudo gitlab-runner register
After that you will enter into an Interactive Registration Prompts
You will be prompted for the following:
GitLab instance URL
https://your.gitlab.example.com
Enter the runner authentication token
Paste your glrt-… token here.
Description for the runner
Example:
my-runner-on-ubuntu
Tags for the runner (comma-separated)
runner,gitlab
Maintenance note (optional)
Example:
Runner hosted in staging VM
Executor type
Choose SSH as executor type and fill the following details in the prompt:
SSH user: (e.g. root)
Password
Host (IP or domain of remote host)
Port
SSH key file: (e.g. /root/.ssh/id_ed25519)
After Registration the runner configuration will be saved in /etc/gitlab-runner/config.toml:
We can see the details of the executor when opens the config.toml file.
cat /etc/gitlab-runner/config.toml
concurrent = 1
check_interval = 0
connection_max_age = "15m0s"
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "gitlab runner"
url = "https://gitlab.codinol.top"
id = 2
token = "glrtr-yFJ_IST5d8BLtnsnc0waeG86MQpwOjEKdDozCw.01.12177l68o"
token_obtained_at = 2025-07-29T07:11:25Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "ssh"
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.ssh]
user = "root"
password = "C58d1CkP6la0Vo"
host = "46.2.3.16"
port = "22"
identity_file = "/root/.ssh/id_ed25519"
You can now start the runner (if not already running):
sudo gitlab-runner start
Conclusion
You can now trigger CI/CD pipelines from your GitLab project, and they will be executed via your SSH-connected runner. Setting up GitLab Runner with an SSH executor gives you flexibility and full control over the build environment. This setup is especially helpful for self-hosted environments or when working with private infrastructure.
If you need expert help to install and register GitLab Runner or to streamline your CI/CD pipeline, our team is here to assist. At Skynats, we offer reliable DevOps support services to help you automate, deploy, and scale with confidence. Contact us today to get personalized support and accelerate your DevOps journey.