6.13.2. Setting up a local GitLab runner

This is useful for local dev testing of GitLab CI. Install gitlab-runner

See install for platform specific GitLab runner installation. Mac OSx

brew install gitlab-runner Windows

  1. Create a folder somewhere in your system, ex.: C:\GitLab-Runner.
  2. Download the binary for 64-bit or 32-bit and put it into the folder you created. The following assumes you have renamed the binary to gitlab-runner.exe (optional). You can download a binary for every available version as described in download any other tagged release.
  3. Make sure to restrict the Write permissions on the GitLab Runner directory and executable. If you do not set these permissions, regular users can replace the executable with their own and run arbitrary code with elevated privileges.
  4. Run an elevated command prompt to register. Linux

To download the appropriate package for your system:

  1. Find the latest file name and options at GitLab Runner Latest.
  2. Choose a version and download a binary, as described in the documentation for downloading any other tagged releases for bleeding edge GitLab Runner releases.

For Debian or Ubuntu:

curl -LJO "https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_${arch}.deb"

For CentOS or Red Hat Enterprise Linux:

curl -LJO "https://gitlab-runner-downloads.s3.amazonaws.com/latest/rpm/gitlab-runner_${arch}.rpm" Install

Install the package for your system as follows.

For Debian or Ubuntu:

dpkg -i gitlab-runner_<arch>.deb

For CentOS or Red Hat Enterprise Linux:

rpm -i gitlab-runner_<arch>.rpm Register the runner

Registering a runner is the process that binds the runner with one or more GitLab instances.

See register for details on platform specific register commands.

Set the URL:

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):

Set the token:

Please enter the gitlab-ci token for this runner:
Fetch from Settings -> CI / CD -> Runners

Give the runner a name:

Please enter the gitlab-ci description for this runner:

Add tags:

Please enter the gitlab-ci tags for this runner (comma separated):

Select the executor:

Please enter the executor: docker+machine, kubernetes, custom, docker-ssh, parallels, shell, ssh, virtualbox, docker, docker-ssh+machine:

The runner will now appear in GitLab: Settings -> CI / CD -> Runners Links