🌐
GitLab
docs.gitlab.com › runner › register
Registering runners | GitLab Docs
Template settings are merged only for options that are: ... Command-line arguments or environment variables take precedence over settings in the configuration template. For example, if the template specifies a docker executor, but the command line specifies shell, the configured executor is shell. To test GitLab Community Edition integrations, use a configuration template to register a runner with a confined Docker executor.
🌐
GitHub
github.com › tobilg › gitlab-ci-runner-marathon › blob › master › docs › gitlab_runner_register_arguments.md
gitlab-ci-runner-marathon/docs/gitlab_runner_register_arguments.md at master · tobilg/gitlab-ci-runner-marathon
July 4, 2023 - NAME: register - register a new runner USAGE: command register [command options] [arguments...] OPTIONS: -c, --config "/etc/gitlab-runner/config.toml" Config file [$CONFIG_FILE] --tag-list Tag list [$RUNNER_TAG_LIST] -n, --non-interactive Run registration unattended [$REGISTER_NON_INTERACTIVE] --leave-runner Don't remove runner if registration fails [$REGISTER_LEAVE_RUNNER] -r, --registration-token Runner's registration token [$REGISTRATION_TOKEN] --name, --description "f3c40eb54139" Runner name [$RUNNER_NAME] --limit "0" Maximum number of builds processed by this runner [$RUNNER_LIMIT] --output-limit "0" Maximum build trace size in kilobytes [$RUNNER_OUTPUT_LIMIT] -u, --url Runner URL [$CI_SERVER_URL] -t, --token Runner token [$CI_SERVER_TOKEN] --tls-ca-file File containing the certificates to verify the peer when using HTTPS [$CI_SERVER_TLS_CA_FILE] --executor Select executor, eg.
Author   tobilg
🌐
GitHub
github.com › FlakM › gitlab-runner-auto-register
GitHub - FlakM/gitlab-runner-auto-register: Gitlab Runner that auto registers on start and unregisters at stop based on environment
To create runner that registres itself in more then one project set LOCKED_MODE to false and provide both ADMIN_TOKEN and PROJECTS_TO_REGISTER variables. REGISTRATION_TOKEN="" ADMIN_TOKEN="" PROJECTS_TO_REGISTER="5309683;4904307" docker run ...
Starred by 12 users
Forked by 11 users
Languages   Shell 67.2% | Dockerfile 32.8% | Shell 67.2% | Dockerfile 32.8%
🌐
GitHub
github.com › pcodk › gitlab-runner-auto-register
GitHub - pcodk/gitlab-runner-auto-register: Gitlab Runner that auto registers on start and unregisters at stop based on environment
Heavily based on: https://github.com/ayufan/gitlab-ci-multi-runner/tree/master/dockerfiles/ubuntu ... docker run -e "CI_SERVER_URL=https://gitlab.example.com/" -e "REGISTRATION_TOKEN=XXXXXXXXXXXXXX" -e PRIVILIGED_MODE={true|false} gitlab-runner-auto-register
Starred by 4 users
Forked by 13 users
Languages   Shell 100.0% | Shell 100.0%
🌐
GitLab
docs.gitlab.com › runner
GitLab Runner | GitLab Docs
sequenceDiagram participant GitLab participant GitLabRunner participant Executor opt registration GitLabRunner ->>+ GitLab: POST /api/v4/runners with registration_token GitLab -->>- GitLabRunner: Registered with runner_token end loop job requesting and handling GitLabRunner ->>+ GitLab: POST /api/v4/jobs/request with runner_token GitLab -->>+ GitLabRunner: job payload with job_token GitLabRunner ->>+ Executor: Job payload Executor ->>+ GitLab: clone sources with job_token Executor ->>+ GitLab: download artifacts with job_token Executor -->>- GitLabRunner: return job output and status GitLabRunner -->>- GitLab: updating job output and status with job_token end
🌐
GitHub
github.com › mesosphere-backup › dcos-gitlab-runner-service › blob › master › docs › gitlab_runner_register_arguments.md
dcos-gitlab-runner-service/docs/gitlab_runner_register_arguments.md at master · mesosphere-backup/dcos-gitlab-runner-service
March 2, 2017 - NAME: register - register a new runner USAGE: command register [command options] [arguments...] OPTIONS: -c, --config "/etc/gitlab-runner/config.toml" Config file [$CONFIG_FILE] --tag-list Tag list [$RUNNER_TAG_LIST] -n, --non-interactive Run registration unattended [$REGISTER_NON_INTERACTIVE] --leave-runner Don't remove runner if registration fails [$REGISTER_LEAVE_RUNNER] -r, --registration-token Runner's registration token [$REGISTRATION_TOKEN] --name, --description "f3c40eb54139" Runner name [$RUNNER_NAME] --limit "0" Maximum number of builds processed by this runner [$RUNNER_LIMIT] --output-limit "0" Maximum build trace size in kilobytes [$RUNNER_OUTPUT_LIMIT] -u, --url Runner URL [$CI_SERVER_URL] -t, --token Runner token [$CI_SERVER_TOKEN] --tls-ca-file File containing the certificates to verify the peer when using HTTPS [$CI_SERVER_TLS_CA_FILE] --executor Select executor, eg.
Author   mesosphere-backup
🌐
GitHub
github.com › OneUptime › blog › blob › master › posts › 2026-03-04-configure-gitlab-runner-rhel-9 › README.md
blog/posts/2026-03-04-configure-gitlab-runner-rhel-9/README.md at master · OneUptime/blog
# Install Docker (or Podman) sudo dnf install -y docker sudo systemctl enable --now docker sudo usermod -aG docker gitlab-runner # Register with the Docker executor sudo gitlab-runner register \ --non-interactive \ --url "https://gitlab.example.com" \ --registration-token "YOUR_TOKEN" \ --executor "docker" \ --docker-image "registry.access.redhat.com/ubi9/ubi:latest" \ --description "rhel9-docker-runner" \ --tag-list "rhel9,docker"
Author   OneUptime
🌐
GitHub
gist.github.com › fabiohbarbosa › 2a13121c4e479e17cca5012b9e9db880
Script to register a new runner on Gitlab CI · GitHub
Script to register a new runner on Gitlab CI. GitHub Gist: instantly share code, notes, and snippets.
🌐
GitHub
gist.github.com › Mearman › 318b96efb31ed33d9c2efa959784d6d8
GitLab Runner Registration Environment Variables.md · GitHub
GitLab Runner Registration Environment Variables.md · https://docs.gitlab.com/runner/configuration/advanced-configuration.html · https://docs.gitlab.com/runner/configuration/autoscale.html#runner-global-options · https://docs.gitlab.com/runner/configuration/autoscale.html#runners-options ·
Find elsewhere
🌐
Readthedocs
codechecker.readthedocs.io › en › latest › gitlab_integration
1. Install/register GitLab Runner - CodeChecker
sudo gitlab-runner register \ --non-interactive \ --url "https://mycompany.gitlab.com" \ --registration-token "<REGISTRATION_TOKEN_FROM_GITLAB>" \ --description "codechecker" \ --executor "shell"
🌐
GitLab
docs.gitlab.com › runner › commands
GitLab Runner commands | GitLab Docs
GitLab Runner contains a set of commands you use to register, manage, and run your builds. ... Most of the commands support environment variables as a method to pass the configuration to the command. You can see the name of the environment variable when invoking --help for a specific command. For example, you can see below the help message for the run command: ... NAME: gitlab-runner run - run multi runner service USAGE: gitlab-runner run [command options] [arguments...] OPTIONS: -c, --config "/Users/ayufan/.gitlab-runner/config.toml" Config file [$CONFIG_FILE]
🌐
GitHub
github.com › ebarault › ansible-role-gitlab-runner-docker › blob › master › gitlab-runner-register.md
ansible-role-gitlab-runner-docker/gitlab-runner-register.md at master · ebarault/ansible-role-gitlab-runner-docker
OPTIONS: -c value, --config value Config file (default: "/etc/gitlab-runner/config.toml") [$CONFIG_FILE] --tag-list value Tag list [$RUNNER_TAG_LIST] -n, --non-interactive Run registration unattended [$REGISTER_NON_INTERACTIVE] --leave-runner Don't remove runner if registration fails [$REGISTER_LEAVE_RUNNER] -r value, --registration-token value Runner's registration token [$REGISTRATION_TOKEN] --run-untagged Register to run untagged builds; defaults to 'true' when 'tag-list' is empty [$REGISTER_RUN_UNTAGGED] --locked Lock Runner for current project, defaults to 'true' [$REGISTER_LOCKED] --name
Author   ebarault
Top answer
1 of 3
15

There isn't an easy way to do what you want, from what I can find in the GitLab documentation and some open issues that they have.

Here is an issue that describes something similar to what you want:

https://gitlab.com/gitlab-org/gitlab-runner/issues/3540

Here is what I think is GitLab's goal with how to register runners:

https://gitlab.com/gitlab-org/gitlab-ce/issues/40693

I believe that the only thing that you can't change from the .toml file is the name of the runner, and maybe not the tags either. Then name is only created when you register the runner. I read something somewhere that you can change the tags of a shared runner, but I can't find it now.

Here is a workaround to make the process of registering a bit more automatic:

https://gitlab.com/gitlab-org/gitlab-runner/issues/3553#note_108527430

He used this API:

curl --request POST "https://gitlab.com/api/v4/runners" --form "token=<registration-token>" --form "description=test-1-20150125-test" --form "tag_list=ruby,mysql,tag1,tag2"

Then he got the following response back:

{"id":401513,"token":"<runner-token>"}

He could then inject the runner-token into his already pre-made .toml file.

For you, it would have been possible to use the registration token for your group, and then to write in the description/name of the runner and the tags. You could then have re-used your config.toml and only changed the runner-token, and it should have worked.

2 of 3
0

A gitlab runner can be registered with multiple projects and/or groups. This will just append the configurations in /etc/gitlab-runner/config.toml (with sudo). Can we just do the following steps:

  1. Un-register the gitlab-runner associated with the "project"
  2. Register the the gitlab-runner associated with the "group"

config.toml stores all the configuration which is passed to gitlab-runner register including any environment variables which are listed under gitlab-runner register -h command.

I am not sure why do you need to save the config.toml.

Also, I believe one source of confusion could be gitlab-runner-token VS gitlab-runner-registration-token. The registration-token can NOT be used inside config.toml which may be the reason why you failed after just a replacement. If you do not want to use gitlab-runner register command and just update the config.toml then follow the steps defined in the above ans to fetch the gitlab-runner-token and use it in config.toml. We can then try and stop and start the gitlab-runner service using sudo service gitlab-runner stop and sudo service gitlab-runner start

🌐
GitHub
gist.github.com › ustun › 65a31adcb66a11cd1cbc5006fdb54681
Running multiple GitLab CI runners · GitHub
Register the service as root user by passing the path to the toml file and the user flag and the service name (needs to be unique per user or runner). gitlab-runner install --config /home/myuser/.gitlab-runner/config.toml --user myuser ...
🌐
GitLab
docs.gitlab.com › tutorials › automate_runner_creation
Tutorial: Automate runner creation and registration | GitLab Docs
After you create a runner and its configuration, you can use the same runner authentication token to register multiple runners with the same configuration. For example, you can deploy multiple instance runners with the same executor type and job tags to the target compute host.
🌐
Cam
guidebook.devops.uis.cam.ac.uk › howtos › git-gitlab › register-a-gitlab-runner
Registering a Gitlab Runner - DevOps Division Guidebook
As a side effect of this, there might be a situation where runner is registered but the behaviour is changed (for example, runner starts to pick up the untagged jobs or tags are missing). That is why it is important to remember that now the configuration must be done before the registration, CLI options (as well as Helm values) will be ignored. ... gitlab-runner register \ --non-interactive \ --executor "shell" \ --url "https://gitlab.developers.cam.ac.uk/" \ --tag-list "shell,mac,gdk,test" \ --run-untagged "false" \ --locked "false" \ --access-level "not_protected" \ --registration-token "REDACTED"
🌐
GitLab
docs.gitlab.com › ci › runners
Runners | GitLab Docs
September 22, 2022 - Runners can be group, project, or instance runners. GitLab-hosted runners are instance runners. ... Fully managed by GitLab. Available immediately without setup. Run on fresh VMs for each job. Include Linux, Windows, and macOS options.
🌐
GitHub
github.com › ayufan › gitlab-ci-multi-runner › blob › master › docs › commands › README.md
gitlab-ci-multi-runner/docs/commands/README.md at master · ayufan/gitlab-ci-multi-runner
August 10, 2018 - Executing gitlab-runner register adds a new configuration entry, it doesn't remove the previous ones. There are two options to register a Runner, interactive and non-interactive.
Author   ayufan
🌐
GitHub
github.com › riemers › ansible-gitlab-runner › issues › 353
register-runner can no longer specify various tags · Issue #353 · riemers/ansible-gitlab-runner
November 18, 2024 - For more information, see https://docs.gitlab.com/ee/ci/runners/new_creation_workflow.html#changes-to-the-gitlab-runner-register-command-syntax\u001b[0;m "], "stdout": "", "stdout_lines": []} Reformatted slightly for easier reading. ... In the role task file register-runner.yml, removing the --locked and --tag-list runner registration options allowed it to move past the error.
Author   patrickstump
🌐
EDUCBA
educba.com › home › software development › software development tutorials › git tutorial › gitlab runner register
Gitlab runner register | Learn the Overviews of Gitlab runner register
April 15, 2023 - This command uses a Runners API, which is an Application programming interface for registering or unregistering runners in Gitlab. The command would need either the entire URL and the token of the runner that needs to be unregistered or the name of the runner. This command also provides an option –all-runners which allows unregistering of all attached runners.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai