NinjaOps Guides › CI/CD & Infrastructure

Complete Guide to Setting Up GitHub Actions Self-Hosted Runners

Published: October 2026 · 14 Min Read · Architecture & DevOps Playbook

#AmazonAssociate Disclosure: As an Amazon Associate, NinjaOps earns from qualifying purchases (tag dev0ps-20).

GitHub-hosted runners provide a quick way to execute CI/CD workflows, but as build concurrency and resource demands grow, public runner costs soar. Setting up self-hosted GitHub Actions runners on Kubernetes or dedicated cloud VMs gives engineering teams full control over CPU/RAM allocation, GPU acceleration, private VPC access, and custom build Caching.

This complete architecture guide covers deploying ephemeral runner pods on Kubernetes using actions-runner-controller (ARC), optimizing Docker layer caching, and hardening runner security against malicious pull requests.

1. Kubernetes Deployment via Actions-Runner-Controller (ARC)

Running persistent VMs for self-hosted runners creates state pollution across builds and introduces security risks. Ephemeral runners destroy the container pod immediately after executing a job, guaranteeing a clean workspace.

# Install Actions Runner Controller via Helm
helm repo add actions-runner-controller https://actions-runner-controller.github.io/actions-runner-controller
helm repo update

helm upgrade --install arc actions-runner-controller/actions-runner-controller   --namespace arc-systems   --create-namespace   --set authSecret.github_token="ghp_YourGitHubPATTokenHere"

2. Managing Memory Limits & OOM Container Crashes

Heavy Docker builds and multi-arch image compilations can cause runner pods to exceed cgroup limits, resulting in silent failures like Docker Exit Code 137 (OOMKilled) or Docker Sock Permission Denied errors.

Recommended CI/CD & Cloud Hardware Gear

Scale your build infrastructure and secure runner credentials with these top-rated DevOps tools:

Spin Up Cloud Build Nodes →

3. Securing Self-Hosted Runners for Public & Private Repos

Never enable self-hosted runners on untrusted public repositories without fork protection. Malicious pull requests can execute arbitrary code inside your VPC. Enforce ephemeral: true and strictly isolate runner service accounts using Kubernetes RBAC and network policies.

Related DevOps Fixes & Infrastructure Hubs

Discover step-by-step troubleshooting solutions and architecture guides across our hubs: