Gitlab Runner Installation Steps
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
- Log in to your GitLab account and go to the CI/CD tab.
- Create a new token with the “New Instance” button.
- 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:
- Server URL: Enter the URL of your GitLab server, for example:
https://gitlab.tr.mert.co/
. - Hostname: Enter the hostname or name of your server.
- Select Executor: Choose the executor you want to use, for example,
docker
. - 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.