Install Gitlab runner and Docker

Install Gitlab runner and Docker

This page explains how to install a remote host using GitLab Runners.

👾
Tip: You may install GitLab Runner and docker directly on your target if it is possible. This remove the need of an extra PC and the need for communication between the Target and the Host. (The Target is the Host too).
ℹ️
Note: As recomended, this section assumes that the OS of the host is Ubuntu 22.04. You may use any other OS that supports the required tools.

Installation

Here is all the software that need to be installed on the host.

Update

Start by update your system with :

sudo apt update

Install GitLab Runner

If you are installing GitLab Runner on another system use GitLab Runner official documentation.

Add the official GitLab repository :

curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash

Install the latest version of GitLab Runner :

sudo apt-get install gitlab-runner

Install Docker

If you are installing docker on another system use docker official documentation.

Install a few prerequisite packages :

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Then add the GPG key for the official Docker repository to your system:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add the Docker repository to APT sources:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

Install docker :

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Finally, make sure your user has access to docker. You may need to add docker to your user group.