Skip to content

Specifying The Custom Runner Server Setup Script

Vitaliy Zakaznikov edited this page Dec 6, 2025 · 5 revisions

You can specify a custom runner server setup script using the --scripts option to specify a path to the folder that contains all your custom runner server scripts.

❗Important:

When using a custom scripts folder with the --scripts option, you must include all required setup and startup scripts including any scripts used by default (setup.sh, startup-x64.sh, startup-arm64.sh) plus your additional custom scripts. The application looks for scripts only in that folder, and missing scripts will cause errors. Copy the default scripts from the repository:

Setting Up Custom Scripts

For example, create a local folder called scripts:

mkdir scripts

Then, copy all required setup and startup scripts from the repository and customize the setup.sh script as needed. For example,

scripts/setup.sh:
#!/bin/bash
set -x
echo "Create and configure ubuntu user"
adduser ubuntu --disabled-password --gecos ""
echo "%wheel   ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
addgroup wheel
addgroup docker
usermod -aG wheel ubuntu
usermod -aG sudo ubuntu
usermod -aG docker ubuntu
# custom setup
apt-get -y update
apt-get -y install ca-certificates curl gnupg lsb-release python3-pip git unzip

You can apply your custom scripts using the --scripts option as follows:

github-hetzner-runners --scripts ./scripts

Job Specific Custom Setup Script

The default server setup script is setup.sh. However, you can use the setup-{name} label to select any custom script inside the scripts directory, where {name} matches the {name}.sh file inside the scripts folder.

✋ Note: Note the .sh extension is assumed for the script {name}.

For example,

scripts/
scripts/custom.sh
job-name:
   runs-on: [self-hosted, setup-custom]

Clone this wiki locally