Self-hosted Runners Overview
What you'll learn: When and why you'd run GitHub Actions workflows on your own infrastructure instead of GitHub's provided runners.
What Are Self-hosted Runners?
While GitHub-hosted runners (covered in the previous lesson) are convenient and maintained by GitHub, self-hosted runners are machines you manage and configure yourself that execute your GitHub Actions workflows. Think of it like choosing between renting a hotel room (GitHub-hosted) versus using your own house (self-hosted) — your house gives you complete control over the environment, amenities, and access rules.
When to Use Self-hosted Runners
You'll want self-hosted runners when:
- Custom environments: You need specific hardware (GPUs, ARM processors), operating systems, or software pre-installed that GitHub-hosted runners don't provide
- Private infrastructure access: Your workflows must reach internal databases, on-premises systems, or private networks that aren't internet-accessible
- Performance requirements: You need faster build times with more powerful machines or persistent caching across runs
- Cost optimization: For heavy usage, running on your existing infrastructure might be more economical
- Security and compliance: Your organization requires workflows to run within your security perimeter or meet specific regulatory requirements
The Trade-off
Self-hosted runners give you flexibility and control, but you're responsible for maintenance, security patches, scaling, and keeping the runner software updated. You must also secure these runners carefully since they execute untrusted code from pull requests.
Key Takeaway: Self-hosted runners let you run GitHub Actions workflows on your own infrastructure, ideal for custom environments, private network access, and specialized hardware needs — at the cost of managing the infrastructure yourself.