What are self-hosted runners?

· Category: DevOps & CI/CD

Short answer

Self-hosted runners are machines that you manage to run GitHub Actions workflows. They are useful for private networks, custom hardware, or workflows with specific dependencies.

Steps

  1. Install the runner application on your machine.
  2. Register the runner with your repository or organization.
  3. Tag the runner for job routing.
  4. Start the runner service.

Example

./config.sh --url https://github.com/org/repo --token TOKEN
./run.sh

Why it matters

Self-hosted runners provide control over the execution environment, access to internal resources, and potential cost savings for large workloads.

Tips

  • Isolate runners in clean VMs or containers for security.
  • Use runner groups for access control.
  • Monitor runner health and scale with auto-scaling groups.

Common issues

  • Runners can be compromised if not isolated.
  • Long-lived runners accumulate state and cause flaky builds.
  • Network issues between runners and GitHub can cause job failures.