The steps for getting the runner up and running (and surviving reboots) should be something along the lines of:
- Download the runner
- Register the runner
- Install the runner and service with:
gitlab-runner install
gitlab-runner start
The machine should now be ready to serve as a runner, and nothing else needs to be done to it (until you want to update the runner...).
Should register be called once or every time I reboot the system. What about install and start?
Register should be called once, this creates a config.toml file which saves the configuration of the registration across reboots. The files location changes depending on how it was registered. IE on Linux, registering a shell runner with sudo, would save the config.toml file to /etc/gitlab-runner/config.toml.
With regards to install and start, also only needs to be run once and survives across reboots. The install installs the GitLab Runner as a service, and start just runs it the first time.
To restart a runner should I do stop , uninstall and then install start run?
Just do a gitlab-runner restart.
Should I have to run it or start would have the same effect?
If you have done an install and start you have no need to use run. I believe run is only for one use (on the open terminal) for debugging jobs. start is for the service on the machine.
HTH.
Answer from Rekovni on Stack Overflowgitlab-runner commands lifecycle for restarting runner - Stack Overflow
Stop and start runner when needed
Can I stop/pause individual docker executor runners on a single machine?
Restarted gitlab-runner, triggered job code to run
Hey all,
Im part of a small dev team working on an unreal engine project. We have a build server on amazon ec2 that we'd like to start up and shut down when a pipeline starts and finishes to keep costs down. We need a persistent instance for incremental builds, as it keeps build times down for testing in quick succession.
I've tried using auto scaling with a gitlab runner 'manager' but its proved a pain for windows instances, then I was considering a warm pool with a reusable instance but again its a lot of faff.
I wish I could a gitlab runner manager that fires up the instance when needed then shuts it down when it isnt. Nice and simple right? But i am racking my brain on how to go about it.
Any solutions?
Today I upgraded a Gitlab-runner on a RedHat 7 server. The runner is used primarily to start/stop the application on the server. When restarting the gitlab-runner, the application on the server stopped. Did restarting the gitlab-runner somehow launch code to stop the application without someone manually launching the pipeline job?
Has anyone seen or experienced something similar? I've just begun digging into root cause.
List runners to get their tokens and URLs:
sudo gitlab-runner listVerify with delete option specifying runner's token and URL:
sudo gitlab-runner verify --delete -t YMsSCHnjGssdmz1JRoxx -u http://git.xxxx.com/
Get your runner token and id
First, go to the GitLab settings page and find the token (e.g. 250cff81 in the image below) and the id (e.g. 354472 in the image below) of the GitLab runner which you wish to delete.

Use the gitlab-runner CLI to unregister the runner
If you have access to the machine which was used to register the GitLab runner, you can unregister the runner using the following command, where you replace {TOKEN} with the token of your GitLab runner (e.g. 250cff81 in the example above).
gitlab-runner unregister --url https://gitlab.org/ --token {TOKEN}
Use the GitLab API to unregister the runner
If you no longer have access to the machine which was used to register the runner, or if the runner is associated with multiple projects, you can use the following Python script. Set RUNNER_ID to the id of your runner (e.g. 354472 in the example above) and GITLAB_AUTH_TOKEN to a GitLab token which you can generate from your profile page.
import os
import requests
GITLAB_AUTH_TOKEN = ...
RUNNER_ID = ...
headers = {"PRIVATE-TOKEN": GITLAB_AUTH_TOKEN}
r = requests.get(f"https://gitlab.com/api/v4/runners/{RUNNER_ID}", headers=headers)
runner_data = r.json()
for project in runner_data.get("projects", []):
r = requests.delete(
f"https://gitlab.com/api/v4/projects/{project['id']}/runners/{RUNNER_ID}",
headers=headers,
)
if not r.ok:
print("Encountered an error deleting runner from project:", r.json())
r = requests.delete(f"https://gitlab.com/api/v4/runners/{RUNNER_ID}", headers=headers)
if not r.ok:
print("Encountered an error deleting runner:", r.json())