Course contentsShow
← Cloud and Infrastructure
Lesson 1720 of 2,98935. GitHub ActionsFree lesson

Self-Hosted Runners

Deploy and manage self-hosted runners for custom environments, private networks, or specialized hardware.

Self-Hosted Runners

What you'll learn: How to deploy and manage your own GitHub Actions runners for specialized environments, private networks, or custom hardware requirements.

Beyond GitHub's Hosted Infrastructure

While GitHub provides hosted runners (as you learned earlier), they run on GitHub's infrastructure with standard configurations. Self-hosted runners are machines you provision and manage that execute your workflow jobs. Think of it like choosing between renting a generic apartment (hosted runners) versus owning a custom-built house (self-hosted runners) — you get complete control but also handle the maintenance.

When to Use Self-Hosted Runners

Deploy self-hosted runners when you need:

  • Private network access: Jobs that must reach internal databases, APIs, or services not exposed to the internet
  • Specialized hardware: GPU processing, specific CPU architectures, or unusual memory/storage configurations
  • Custom software: Pre-installed tools, licensed software, or corporate compliance tooling
  • Cost optimization: For high-volume builds, self-hosted runners can be more economical than GitHub's metered pricing
  • Security requirements: Keep source code and artifacts within your controlled infrastructure

Basic Deployment Flow

  1. Provision a machine (physical, VM, or container) running Linux, Windows, or macOS
  2. Install the runner application from your GitHub repository or organization settings
  3. Register the runner using a unique token, assigning it labels (like self-hosted, linux, gpu)
  4. Reference runners in workflows using the runs-on key with your custom labels
  5. Manage lifecycle: Monitor health, apply updates, and scale runner pools as needed

Self-hosted runners automatically pick up jobs matching their labels and report status back to GitHub.

Key Takeaway: Self-hosted runners extend GitHub Actions into your infrastructure, enabling custom environments, private network access, and specialized hardware while requiring you to manage provisioning, security, and maintenance.