Gitlab Runner Installation Steps

mert polat ☁️ ☸️🐳🐧
2 min readApr 24, 2024

Gitlab Runner Installation Steps GitLab Runner Installation — Setting Up GitLab Runner on System with Bash Script

Step 1: Adding Repositories with Bash Script Download and run an automatic bash script that adds the necessary repositories to prepare for installing GitLab Runner on the system.

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

This command sets up the repositories required for GitLab Runner installation.

Step 2: Installing GitLab Runner You can install GitLab Runner on your system with the following command.

sudo yum install -y gitlab-runner

This command allows you to install GitLab Runner on your servers.

Step 3: Registering GitLab Runner

  1. Log in to your GitLab account and go to the CI/CD tab.
  2. Create a new token with the “New Instance” button.
  3. Note down the generated token.

Step 4: Registering GitLab Runner on the Server You can register your GitLab Runner on your server with the following command.

gitlab-runner register --url http://gitlab.tr.mert.co --token {token}

When you run this command, it will ask you various questions. You can answer these questions by following the steps below:

  1. Server URL: Enter the URL of your GitLab server, for example: https://gitlab.tr.mert.co/.
  2. Hostname: Enter the hostname or name of your server.
  3. Select Executor: Choose the executor you want to use, for example, docker.
  4. Docker Image (For Docker Executor): If you choose the Docker executor, specify the Docker image you want to use, for example, alpine.

After completing these steps, your GitLab Runner is configured to communicate with your server, and a configuration file named /etc/gitlab-runner/config.toml is created.

--

--