{"id":15588,"date":"2025-08-12T17:27:09","date_gmt":"2025-08-12T11:57:09","guid":{"rendered":"https:\/\/www.skynats.com\/?p=15588"},"modified":"2025-08-28T18:09:11","modified_gmt":"2025-08-28T12:39:11","slug":"how-to-install-and-register-gitlab-runner","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-install-and-register-gitlab-runner\/","title":{"rendered":"How to Install and Register GitLab Runner"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you&#8217;re setting up a CI\/CD pipeline with GitLab, its an essential step to install and register GitLab Runner. <a href=\"https:\/\/about.gitlab.com\/\" target=\"_blank\" rel=\"noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\">GitLab<\/mark><\/a> Runner is an open-source project used to run your jobs and send the results back to GitLab.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install GitLab Runner from the official repository<\/li>\n\n\n\n<li>Registering the runner using the SSH executor<\/li>\n\n\n\n<li>Configuring the runner for secure, remote job execution<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-prerequisites\"><strong>Prerequisites<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A GitLab account with access to a project or group<\/li>\n\n\n\n<li>A machine (VM or server) where the runner will be installed<\/li>\n\n\n\n<li>A <strong>runner registration token<\/strong> (available via GitLab UI)<\/li>\n\n\n\n<li>SSH access to the remote machine if using the SSH executor<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-1-add-the-official-gitlab-repository\">1: Add the Official GitLab Repository<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -L \"https:\/\/packages.gitlab.com\/install\/repositories\/runner\/gitlab-runner\/script.deb.sh\" | sudo bash<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-2-install-gitlab-runner\">2: Install GitLab Runner<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install gitlab-runner<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-3-verify-installation\">3: Verify Installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command to confirm installation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gitlab-runner --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Installing GitLab Runner using GitLab\u2019s official repositories ensures you always get the latest, secure, and compatible version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\">Register A Runner<\/h2>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\">Prerequisites<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You need a <strong>runner authentication token<\/strong>.<br>You can find it by:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Creating a new runner (Instance\/Group\/Project level).<\/li>\n\n\n\n<li>Or checking an existing config.toml for the token.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\">Register the Runner<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open your terminal and run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo gitlab-runner register<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After that you will enter into an Interactive Registration Prompts<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will be prompted for the following:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>GitLab instance URL<\/strong><strong><br><\/strong>https:\/\/your.gitlab.example.com<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Enter the runner authentication token<\/strong><strong><br><\/strong>Paste your glrt-&#8230; token here.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Description for the runner<\/strong><strong><br><\/strong>Example:<br>my-runner-on-ubuntu<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Tags for the runner<\/strong> (comma-separated)<br>runner,gitlab<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Maintenance note<\/strong> (optional)<br>Example:<br>Runner hosted in staging VM<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Executor type<\/strong><strong><br><\/strong>Choose SSH as executor type and fill the following details in the prompt:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>SSH user:<\/strong> (e.g. root)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Password<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Host<\/strong> (IP or domain of remote host)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Port<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>SSH key file:<\/strong> (e.g. \/root\/.ssh\/id_ed25519)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After Registration the runner configuration will be saved in \/etc\/gitlab-runner\/config.toml:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can see the details of the executor when opens the config.toml file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/gitlab-runner\/config.toml\nconcurrent = 1\ncheck_interval = 0\nconnection_max_age = \"15m0s\"\nshutdown_timeout = 0\n\n&#91;session_server]\n  session_timeout = 1800\n\n&#91;&#91;runners]]\n  name = \"gitlab runner\"\n  url = \"https:\/\/gitlab.codinol.top\"\n  id = 2\n  token = \"glrtr-yFJ_IST5d8BLtnsnc0waeG86MQpwOjEKdDozCw.01.12177l68o\"\n  token_obtained_at = 2025-07-29T07:11:25Z\n  token_expires_at = 0001-01-01T00:00:00Z\n  executor = \"ssh\"\n  &#91;runners.cache]\n    MaxUploadedArchiveSize = 0\n    &#91;runners.cache.s3]\n    &#91;runners.cache.gcs]\n    &#91;runners.cache.azure]\n  &#91;runners.ssh]\n    user = \"root\"\n    password = \"C58d1CkP6la0Vo\"\n    host = \"46.2.3.16\"\n    port = \"22\"\n    identity_file = \"\/root\/.ssh\/id_ed25519\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can now start the runner (if not already running):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo gitlab-runner start<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\">Conclusion<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can now trigger CI\/CD pipelines from your GitLab project, and they will be executed via your SSH-connected runner. Setting up GitLab Runner with an SSH executor gives you flexibility and full control over the build environment. This setup is especially helpful for self-hosted environments or when working with private infrastructure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need expert help to install and register GitLab Runner or to streamline your CI\/CD pipeline, our team is here to assist. At Skynats, we offer reliable <a href=\"https:\/\/www.skynats.com\/devops-support\/\">DevOps support services<\/a> to help you automate, deploy, and scale with confidence. Contact us today to get personalized support and accelerate your DevOps journey.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re setting up a CI\/CD pipeline with GitLab, its an essential step to install and register GitLab Runner. GitLab Runner is an open-source project used to run your jobs and send the results back to GitLab. Prerequisites 1: Add the Official GitLab Repository 2: Install GitLab Runner 3: Verify Installation Run the following command [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1064,1082],"class_list":["post-15588","post","type-post","status-publish","format-standard","hentry","category-blog","tag-devops-support-services","tag-install-and-register-gitlab-runner"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=15588"}],"version-history":[{"count":3,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15588\/revisions"}],"predecessor-version":[{"id":15596,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15588\/revisions\/15596"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=15588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=15588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=15588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}