When you create a new account on gitlab.com, you would have to provide a valid credit/debit card for being able to use free minutes of GitLab Runner.
From the Frequently Asked Questions in the Pricing page, if you choose to use GitLab.com SaaS shared runners, a valid credit/debit card is required as there has been a massive uptick in abuse of free compute minutes available on GitLab.com SaaS to mine cryptocurrencies - which creates intermittent performance issues for GitLab.com SaaS users.
For those who are privacy concerned, you can install GitLab Runner on an infrastructure you own or manage. It can be installed:
Using the GitLab repository for Debian/Ubuntu/CentOS/Red Hat
In a container, as a Docker service, or on Kubernetes
By downloading a binary manually and installing it on GNU/Linux, macOS, Windows or FreeBSD
Install GitLab Runner on Linux
You can install GitLab Runner on Linux using the GitLab repository.
On Debian and derivatives, you should add the official GitLab repository by running the following command:
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash
Then, install the latest version of GitLab Runner:
sudo apt install gitlab-runner
To install a specific version:
apt-cache madison gitlab-runner
sudo apt-get install gitlab-runner=15.11.0
Replacing 15.11.0
with the required version.
And finally, register the runner.
For instructions to install GitLab Runner on other distros, check the documentation.
Create a Shared Runner
There are two ways for creating a shared runner:
- With a runner authentication token
- With a registration token
Using a runner registration token was deprecated in GitLab 15.6 and will be removed in GitLab 18.0. Instead, a runner authentication token will be used. More information in the documentation.
The GitLab Runner can be created directly from the UI following the next steps:
- Go to
Settings
→CI/CD
, in your project - Expand the
Runners
section - Select
New project runner
- Select the operating system where you installed GitLab Runner
- Assign tags to the jobs in your CI/CD pipeline that the runner can run, otherwise mark
Run unstagged jobs
- Add a runner description (optional)
- The
Configuration
section is also optional - Select
Create runner
Register the Runner
After creating the runner, you will get instructions for registering the runner, including the token required.
Run the following command:
sudo gitlab-runner register --url https://gitlab.com --token glrt-JQcTiXyMdgsi5K5BemS6
glrt-JQcTiXyMdgsi5K5BemS6
is the authentication token, generated after creating the runner.
It will prompt you to type the GitLab instance URL (e.g. https://gitlab.com).
Then, enter a name for the runner, stored in the local config.toml
file.
Select an executor. You can use Docker for a clean build environment.
If you choose Docker, you should enter the default Docker image to use (e.g. ruby:2.7
). Default image to use when not defined in your .gitlab-ci.yml
file.
Once the runner is registered, you can verify if it's available to pick up jobs:
sudo gitlab-runner run
And you're ready to go. You have a GitLab Runner up and running that can be used with your CI/CD pipelines.
For those who are privacy concerned, you can install GitLab Runner on an infrastructure you own or manage. It can be installed: Before installing GitLab Runner, make sure Docker is up and running on your system. On GNU/Linux follow the instructions in the documentation or go directly to the section that covers the instructions for your distro: Don't forget to follow post-installation steps. For installing the Docker image, create a Docker volume: Start the GitLab Runner container: Before using your recently installed GitLab Runner, you have to register it. Go to the settings of a GitLab project that you want to use GitLab Runner for and obtain the registration token. In your GitLab repository, go to Settings --> CI/CD and expand the Runners section. From the Specific runners section, copy the registration token. Don't forget to disable Shared runners. Now from the terminal, run the following command: It will ask you for the following information: If you don't assign tags to the jobs in your CI/CD pipeline, the GitLab Runner won't start as it is configured by default to pick jobs that have any of the tags specified in the configuration. For changing this behavior and let the GitLab Runner pick jobs without tags, expand the Runners section from Settings --> CI/CD and click the edit button in the runner you want to modify from the Available specific runners section. Then check the following option: Indicates whether this runner can pick jobs without tags. By default runners are configured to use them only with a specific project, If you want other projects in your account to use this runner, uncheck the option: When a runner is locked, it cannot be assigned to other projects. In other projects, expand the Runners section from Settings --> CI/CD, go to the Available specific runners and click on Enable for this project to choose the runner you want use from the available ones. Now you're ready to use GitLab CI and configure your CI/CD pipelines using your own GitLab Runner.Deprecated Tutorial
When configuring a new GitLab account on GitLab.com you would get access to a 30-day GitLab Ultimate trial and would be required to validate your account with a credit card for using free minutes of GitLab Runner.
Run GitLab Runner in a container
Install the Docker image and start the container
docker volume create gitlab-runner-config
docker run -d --name gitlab-runner --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v gitlab-runner-config:/etc/gitlab-runner \
gitlab/gitlab-runner:latest
Register your runner
docker run --rm -it -v gitlab-runner-config:/etc/gitlab-runner gitlab/gitlab-runner:latest register
Top comments (0)