Skip to main content

Install Gitlab Runner on Debian12

· One min read
Mohammad Zakery

How to Install

Gitlab

1.Install and configure the necessary dependencies.

sudo apt-get install -y curl openssh-server ca-certificates perl

2.Add the GitLab-Runner package repository and install the package.

curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash
chmod 644 /usr/share/keyrings/runner_gitlab-runner-archive-keyring.gpg
apt-get install gitlab-runner

3.To use the GitLab Runner with your GitLab repository, you'll need to add the runner to your repository's settings.

  • Go to your GitLab repository's settings > CI/CD > Runners.
  • Click the "New Project Runner" button.
  • Fill out the form with your runner's information.
  • Save the changes.
caution

Copy the generated token to use in the next step.

4.Register runner to gitlab.

sudo gitlab-runner register

5.Finally, the config file is created in the following path.

sudo cat /etc/gitlab-runner/config.toml