How to install GitLab Runner using the official GitLab repositories
To install GitLab Runner using the official GitLab repositories, follow these steps:
Add the GitLab package repository:
For Debian/Ubuntu: curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash For CentOS/RHEL: curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
Install GitLab Runner:
For Debian/Ubuntu: sudo apt-get install gitlab-runner For CentOS/RHEL: sudo yum install gitlab-runner
Configure GitLab Runner:
After the installation, you need to register the Runner with your GitLab instance. Obtain the registration token from your GitLab project or administrator before proceeding. Run the following command:
sudo gitlab-runner register
Follow the prompts and provide the necessary information, such as the GitLab instance URL, registration token, description for the Runner, and any specific Runner tags or executor configuration required.
Start the GitLab Runner:
After successful registration, start the GitLab Runner service:
For systemd-based systems:
sudo systemctl start gitlab-runner
For sysvinit-based systems:
sudo service gitlab-runner start
The Runner will now be available to execute jobs for your GitLab projects.