This script allows you to easily set up and manage multiple self-hosted GitHub Actions runners on a single machine. It's designed to speed up parallel workflows, reduce runner setup time, and simplify lifecycle management.
- π§ Intelligent one-time runner download (no repeated downloads)
- βοΈ Auto-configuration of multiple runners with unique names
- π Systemd service installation for each runner
- π₯
init
anddeinit
modes to start or clean up all runners - π·οΈ Custom labels for targeted job execution in workflows
- A Linux machine (Ubuntu recommended)
curl
installedsudo
privileges (for service installation)- A valid GitHub Actions runner registration token
You can generate the token in your GitHub repo:
Settings β Actions β Runners β Add Runner β Copy the token
Clone the repo and run:
chmod +x setup-multiple-runners.sh
./setup-multiple-runners.sh init
This will:
- Download the GitHub Actions runner binary (if not already downloaded)
- Create multiple runner directories (e.g. runner-1, runner-2, ...)
- Configure and register each runner with GitHub
- Install and start each runner as a system service
./setup-multiple-runners.sh deinit
This will: Stop and uninstall each runner service Delete all runner directories
Edit the following variables in the script:
GITHUB_URL="https://github.com/<your-username>/<your-repo>"
GITHUB_TOKEN="<your-registration-token>"
RUNNER_VERSION="2.316.1" # Check for updates at https://github.com/actions/runner/releases
NUM_RUNNERS=3 # How many runners you want to spawn
BASE_DIR="$HOME/actions-runners"
In your GitHub Actions .yml
file, use:
runs-on: [self-hosted, parallel]
This will target all runners registered with the parallel
label.
To remove "stale" runners from the GitHub UI manually:
Go to Settings β Actions β Runners β ... β Remove
(Or use the GitHub API to automate this)