Skip to content

Setting Up a Self-Hosted GitHub Runner

Self-hosted runners let you run GitHub Actions jobs on machines you control.

  1. Go to Settings > Actions > Runners and click New self-hosted runner.
  2. Choose the desired OS and architecture and copy the download and configuration commands.
  3. On the target machine, run:
    Terminal window
    ./config.sh --url https://github.com/OWNER/REPO --token YOUR_TOKEN
  4. Optionally add labels during configuration to target specific jobs.
  5. Start the runner:
    Terminal window
    ./run.sh

For long-running usage, install the runner as a service:

Terminal window
sudo ./svc.sh install
sudo ./svc.sh start
  • Use ephemeral runners for untrusted workloads.
  • Restrict network access and keep the machine updated.
  • Regularly rotate runner registration tokens.