What are self-hosted runners and when should you use them?

Answer

Self-hosted runners are machines (physical servers, VMs, containers) that you provision and manage yourself to execute CI/CD jobs, rather than using the CI platform's managed cloud runners. In GitHub Actions, you register a self-hosted runner by installing the runner agent on your machine and connecting it to your repository or organization. Use self-hosted runners when: you need access to on-premises resources (private databases, internal artifact stores, physical hardware); you need specific hardware (GPU for ML pipelines, Apple Silicon for iOS builds); GitHub's managed runners are too slow or expensive at your scale; or compliance/security requirements mandate that build artifacts and secrets never leave your network. The tradeoff is operational overhead — you are responsible for patching, scaling, and maintaining runner infrastructure. GitHub Actions Runner Scale Sets (using Kubernetes) automate runner lifecycle management.