Install GitLab Runner manually on GNU/Linux
If you can’t use the deb/rpm repository to install GitLab Runner, or your GNU/Linux OS is not among the supported ones, you can install it manually using one of the methods below, as a last resort.
If you want to use the Docker executor, you must install Docker before using the Runner.
Make sure that you read the FAQ section which describes some of the most common problems with GitLab Runner.
Using deb/rpm package
It is possible to download and install via a deb
or rpm
package, if necessary.
Download
To download the appropriate package for your system:
- Find the latest file name and options at https://gitlab-runner-downloads.s3.amazonaws.com/latest/index.html.
- 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 example, for Debian or Ubuntu:
curl -LJO https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_<arch>.deb
For example, 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 example, for Debian or Ubuntu:
dpkg -i gitlab-runner_<arch>.deb
For example, for CentOS or Red Hat Enterprise Linux:
rpm -i gitlab-runner_<arch>.rpm
Update
Download the latest package for your system then upgrade as follows:
For example, for Debian or Ubuntu:
dpkg -i gitlab-runner_<arch>.deb
For example, for CentOS or Red Hat Enterprise Linux:
rpm -Uvh gitlab-runner_<arch>.rpm
Using binary file
It is possible to download and install via binary file, if necessary.
Install
gitlab-runner
. If you
want to install a version prior to GitLab Runner 10, visit the old docs.-
Simply download one of the binaries for your system:
# Linux x86-64 sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64 # Linux x86 sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-386 # Linux arm sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-arm # Linux arm64 sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-arm64 # Linux s390x sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-s390x
You can download a binary for every available version as described in Bleeding Edge - download any other tagged release.
-
Give it permissions to execute:
sudo chmod +x /usr/local/bin/gitlab-runner
-
Create a GitLab CI user:
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
-
Install and run as service:
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner sudo gitlab-runner start
gitlab-runner
is installed and run as service (what is described
in this page), it will run as root, but will execute jobs as user specified by
the install
command. This means that some of the job functions like cache and
artifacts will need to execute /usr/local/bin/gitlab-runner
command,
therefore the user under which jobs are run, needs to have access to the executable.Update
-
Stop the service (you need elevated command prompt as before):
sudo gitlab-runner stop
-
Download the binary to replace Runner’s executable. For example:
sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
You can download a binary for every available version as described in Bleeding Edge - download any other tagged release.
-
Give it permissions to execute:
sudo chmod +x /usr/local/bin/gitlab-runner
-
Start the service:
sudo gitlab-runner start