This repository demonstrates how to install and configure a
self-hosted Actions Runner
on a Debian-based system. The actions runner is configured to run jobs for a GitHub repository.
This repository provides
a GitHub Actions workflow
that is triggered by a push event on the main branch. It updates the index.html file in a
Docker Nginx container.
The GitHub Actions workflow assumes that the Nginx container is running on the same machine as the GitHub actions runner. The job will exit with an error if the Nginx container is not running.
- A GitHub account.
- A recent Debian-based system (e.g., Debian Bookworm) with an unprivileged
ocio-runneruser account (for the given example), and which can `sudo to root. - A Docker installation on the system.
- cURL, tar, and git installed on the system.
You can install the required packages on a Debian-based system as follows:
# Update the package list
$ sudo apt update
# Install the required packages
$ sudo apt install -y curl tar gitYou can install the full Docker stack, including Docker compose, by running the following commands:
sudo curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USEROnce done, you need to log out and log back in so that your group membership is re-evaluated. Please, don't execute the
docker command using root user privileges.
Fork this repository to your GitHub account. The forked repository will be used to test the GitHub Actions Runner.
For the given example, it is assumed that an unprivileged UNIX user named ocio-runner exists on the system. If you
want to use another user, make sure to replace ocio-runner with the desired username in the following steps, including
in the ocio-runner.service file (user, WorkingDirectory, and ExecStart fields).
On the target machine (x64 assumed), download the runner package and extract it as follows:
# Change to the ocio-runner user's home directory
$ cd ~
# Create a dedicated directory for the actions runner
$ mkdir actions-runner && cd actions-runner
# Download the latest action runner package for Linux x64
$ curl -o actions-runner-linux-x64-2.322.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.322.0/actions-runner-linux-x64-2.322.0.tar.gz
# Extract the installer
$ tar xzf ./actions-runner-linux-x64-2.322.0.tar.gzNote: Don't forget to check for latest version of the actions runner.
- Go to the forked repository in GitHub (in your user account).
- Go to
Settings->Actions->Runners->New self-hosted runner. - Copy the token which is displayed on the screen, in the configure section.
# Configure the actions runner
$ ./config.sh --url git@github.com:<user>/actions-runner.git --token <token>Replace <user> with your GitHub username and <token> with the token copied from the GitHub repository settings.
For the questions, make use of default values, except for the runner name. For the given example, the runner name is
ocio-runner.
# Change to the ocio-runner user's home directory
$ cd ~
# Clone the forked repository on the target machine
$ git clone git@github.com:<user>/actions-runner.git actions-runner-repository
# Change to the repository directory
$ cd actions-runner-repositoryReplace <user> with your GitHub username.
Note: You should first create a new SSH key pair on the target machine for the ocio-runner user, and add the
public key to your GitHub account. You can create a new SSH key pair as follows:
# Create a new SSH key pair
$ ssh-keygen -t ed25519 -C "<email_address>"Replace <email_address> with your email address.
Then, add the public key to your GitHub account by copying the content of the ~/.ssh/id_ed25519.pub file.
# Copy the service file to /etc/systemd/system/
$ sudo cp -a ocio-actions-runner.service /etc/systemd/system
# Reload the systemd configuration
$ sudo systemctl daemon-reload
# Enable the service
$ sudo systemctl enable ocio-actions-runner
# Start the service
$ sudo systemctl start ocio-actions-runnerOn the same machine as the actions runner, start a Nginx container for testing purposes. The container will serve the
content of the index.html file from this repository.
# Create a dedicated directory inside the ocio-runner user's home directory
$ mkdir ~/nginx-by-ocio-runner
# Copy the docker compose file into the newly created directory
$ cp -a docker-compose.yml ~/nginx-by-ocio-runner
# Start the Nginx container in detached mode
$ docker compose -f ~/nginx-by-ocio-runner/docker-compose.yml up -dNote: It is assumed that the ocio-runner user has the necessary permissions to run Docker (e.g., added to the
docker group).
- Edit the
index.htmlfile inside the forked repository. - Commit and push the changes.
- Wait for the runner to pick up the job and see the changes.
- Check that the Nginx container is serving the updated
index.htmlby visitinghttp://<ip>:9988in a Web browser.
Replace <ip> with the IP address of the machine running the Nginx container.
Laurent DECLERCQ, AGON PARTNERS INNOVATION AG l.declercq@agon-innovation.ch, for AGON PARTNERS SOLUTION GmbH.
© 2025 AGON PARTNERS SOLUTION GmbH. All rights reserved.