Install GitLab Runner on Linux (CI/CD Pipeline Setup)

gitlab runner linux linux-gitlab-runner.png

Run your own GitLab CI/CD pipelines on a Linux server with GitLab Runner. This guide covers install, registration, and a Docker executor — ideal for homelab and production build agents.

Step 1: Install GitLab Runner Package

Add the official GitLab repository and install on Ubuntu: curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash then apt install gitlab-runner. On AlmaLinux use the RPM script.

install gitlab runner package ubuntu almalinux
Step 1: Install GitLab Runner Package

Step 2: Register the Runner

Run gitlab-runner register — enter GitLab URL, registration token (from Settings → CI/CD → Runners), executor docker, and default image docker:24.

gitlab-runner register docker executor linux
Step 2: Register the Runner

Step 3: Verify and Enable Service

Check with gitlab-runner verify and systemctl enable --now gitlab-runner. Push a .gitlab-ci.yml to test your first pipeline job.

gitlab-runner verify systemctl enable linux
Step 3: Verify and Enable Service

Example .gitlab-ci.yml

stages: [test, deploy]

test:
  stage: test
  script:
    - echo "Running tests on Linux runner"

deploy:
  stage: deploy
  script:
    - ./deploy.sh
  only:
    - main

Related tutorials

Terminal screenshots are original illustrations created for Gnome IT Solutions (blog.gnomeitsolutions.com).