GitHub-hosted runners are the easy default for GitHub Actions: you write a workflow, GitHub provides the machine, and the job runs on a clean environment every time. But there comes a point where the default is not enough. Your builds need a GPU, or a licensed tool that only exists on your network, or a machine with far more memory than the hosted options offer, or simply a machine you already pay for that sits idle overnight. That is when you run your own runner.
A self-hosted runner is a machine you deploy and manage that executes jobs from GitHub Actions. It can be physical, virtual, in a container, on-premises or in a cloud — the shape does not matter, the contract does: the runner application connects to GitHub, receives job assignments, runs them, and reports the results back. This guide takes you through that contract end to end: choosing between hosted and self-hosted, meeting the requirements, registering your first runner, routing jobs with labels, keeping the fleet healthy, securing it, and scaling it when one machine is no longer enough.
Self-Hosted vs GitHub-Hosted Runners
The trade-off is control against convenience. GitHub-hosted runners need no setup, start from a clean image for every job, and disappear when the job finishes, which makes them the safest choice for public repositories and the simplest choice for most teams. Self-hosted runners give you custom hardware, custom software and access to your local network, and they cost nothing from GitHub — you pay for the machines you already own or rent. The price of that control is that you own the maintenance: patching, monitoring, scaling and securing the fleet is your job now.
Choose self-hosted when the job has a requirement the hosted runners cannot meet. The common reasons are specialised hardware such as GPUs or Apple silicon for iOS builds, software that is licensed to a specific machine or only available on your internal network, very large jobs that need more CPU or memory than hosted runners provide, and jobs that must run inside a private network to reach internal services. Choose hosted when none of those apply, and especially for public repositories, where a self-hosted runner can be tricked into running untrusted code from a fork — a risk covered in detail in the security section below.
There are differences in behaviour to plan for. GitHub-hosted runners always start clean, so a job cannot be affected by the previous job's leftovers. A self-hosted runner keeps its state between jobs unless you clean it, which means a build that passes on a hosted runner can fail on a self-hosted one because of a cached dependency, and a job can accidentally read files left behind by the previous job. The runner application itself receives automatic updates, though you can disable them — keep them on unless you have a reason not to, because an outdated runner is a runner with known bugs. If you have not used Actions at all yet, our GitHub Actions tutorial builds your first workflow on hosted runners first, and our CI/CD pipeline explained guide covers the concepts — build, test, deploy — that the runners in this guide exist to execute.
Requirements: OS, Hardware and Network
A machine can be a self-hosted runner if it meets three conditions: you can install and run the runner application on it, it can communicate with GitHub Actions, and it has enough hardware for the workflows you plan to run. The runner application itself needs only minimal resources — the hardware requirement comes from your jobs, not from the runner, so size the machine for the heaviest workflow it will run, not for the runner process.
GitHub documents the supported operating systems on the self-hosted runners reference page. On Linux, that includes Red Hat Enterprise Linux 8 or later, CentOS 8 or later, Oracle Linux 8 or later, Fedora 29 or later, Debian 10 or later, Ubuntu 20.04 or later, Linux Mint 20 or later, openSUSE 15.2 or later and SUSE Enterprise Linux 15 SP2 or later. On Windows, it is Windows 10 64-bit, Windows 11 64-bit and Windows Server 2016, 2019 and 2022, all 64-bit. On macOS, it is macOS 11.0 (Big Sur) or later. The supported processor architectures are x64 on all three platforms, and ARM64 on Linux, macOS and Windows, which the reference page marks as currently in public preview. If your machine runs an older operating system than these minimums, upgrade it before you start — an unsupported OS is the most common reason a runner installation fails.
One rule catches many teams: if your workflows use Docker container actions or service containers, you must use a Linux machine with Docker installed. Container actions do not run on Windows or macOS runners, so a team that standardises on container actions needs a Linux fleet even if its developers use Macs. Check what your workflows actually use before you choose the fleet's operating system.
The network requirements are modest but specific. The runner needs at least 70 kilobits per second of upload and download speed, and it must be able to reach GitHub's domains over HTTPS on port 443. The runner connects out to GitHub — GitHub does not connect in to the runner — so you do not need to open inbound ports, but a restrictive corporate proxy or firewall that blocks the GitHub domains will stop the runner from receiving jobs. If the runner is behind a proxy, configure the proxy in the runner's environment before registration, and verify the connection with a simple job before you declare the runner ready.
Size the hardware for the job, not for the runner. A machine that only runs linting and unit tests is comfortable with two CPUs and a few gigabytes of memory, while a machine that builds container images or compiles a large codebase wants four or more CPUs, at least 16 gigabytes of memory, and fast local disk — image builds are usually disk-bound before they are CPU-bound. Give the runner a generous disk: a single Docker build can leave behind gigabytes of layers, and a runner that shares a small disk with the operating system will fill it without warning. If you run several runners on one host, remember they share the host's resources, so the sizing is per concurrent job, not per machine. Start with one runner per machine while you learn the load pattern, and only pack multiple runners onto a host once you know how much a single job actually consumes.
Installing and Registering Your First Runner
Registration starts in the GitHub UI, not on the machine. Open the repository, organisation or enterprise settings, go to Actions, then Runners, and click New self-hosted runner. Choose the operating system and architecture, and GitHub shows you the exact download and configuration commands for that platform, including a registration token that is generated for you. That token expires after one hour, so have the machine ready before you generate it — if it expires, generate a new one and start the configuration step again.
On a Linux machine, the commands look like this. The version in the download URL is whatever GitHub shows on the New runner page at the time you register — use the commands from that page, not a version number from a tutorial, because the runner is updated regularly:
# Create a directory for the runner and move into it mkdir actions-runner && cd actions-runner # Download the runner package shown on the New runner page. # Copy the URL from that page — it contains the current version number, # which changes with every release, so do not copy one from a tutorial. curl -o actions-runner-linux-x64.tar.gz -L \ https://github.com/actions/runner/releases/download/v2.338.2/actions-runner-linux-x64-2.338.2.tar.gz # Extract the package tar xzf ./actions-runner-linux-x64.tar.gz # Install the dependencies the runner needs sudo ./bin/installdependencies.sh # Configure the runner — the URL is your repository or organisation, # and the token is the one shown on the New runner page ./config.sh --url https://github.com/your-org/your-repo --token YOUR_TOKEN # Start the runner ./run.sh The version in that download URL is 2.338.2, the current release as of 2 December 2026. If you are reading this later, copy the exact URL from the New self-hosted runner page, because the runner is updated regularly — if you hard-code an old version from a blog post, you will install an old runner and spend an afternoon wondering why a feature is missing.
Run the runner as a dedicated, unprivileged user — never as root. Create a user account for the runner, give it ownership of the runner directory, and run the configuration and the runner process as that user. The configuration script asks a few questions: the runner's name, whether to add custom labels, and which work folder to use. Accept the defaults the first time, verify the runner appears in the GitHub UI with the status Idle, and only then start customising. GitHub's enterprise guide, Getting started with self-hosted runners for your enterprise, walks through the same flow at organisation and enterprise level, including the policy that restricts which actions and reusable workflows are allowed — worth reading before you add runners to an organisation rather than a single repository.
Labels and Routing Jobs to the Right Runner
Labels are how GitHub decides which runner runs a job. Every runner automatically gets the labels self-hosted, its operating system (linux, windows or macos) and its architecture (x64 or arm64). You can add custom labels at registration time with the --labels flag, and a workflow requests runners by listing the labels its jobs need:
./config.sh --url https://github.com/your-org/your-repo \ --token YOUR_TOKEN \ --labels gpu,cuda,linux-large jobs: train-model: runs-on: [self-hosted, gpu, cuda] steps: - uses: actions/checkout@v4 - run: python train.py build: runs-on: [self-hosted, linux, large] steps: - uses: actions/checkout@v4 - run: make build GitHub routes a job to a runner that matches all of the requested labels, and the routing rules have a few sharp edges. A job that asks for a label no runner has will sit in the queue until it fails — the maximum time a job stays queued before it fails is 24 hours, and if an assigned runner does not pick the job up within 60 seconds, GitHub re-queues it to another matching runner. A job that asks only for self-hosted can land on any runner in the pool, including one without the tools it needs, so be specific about the labels that matter and keep the label set small: a handful of meaningful labels per runner is maintainable, while a dozen overlapping labels becomes a routing puzzle nobody can reason about.
Runner groups add a layer of access control on top of labels. At organisation and enterprise level, you can put runners into groups and decide which repositories may use each group — a GPU group for the machine-learning repositories, a general group for everything else. Groups are the mechanism that stops a repository from borrowing a runner it should not have access to, and they are worth setting up before the fleet grows, because retrofitting access control onto a fleet that every repository already uses is a migration in itself.
Running as a Service and Keeping Runners Healthy
A runner started with ./run.sh in a terminal stops when the terminal closes and does not survive a reboot. For anything beyond a first experiment, install the runner application as a service. On Linux that means systemd, on macOS a launchd agent, and on Windows a Windows service — GitHub's documentation covers each platform, and the commands are run from the runner directory:
sudo ./svc.sh install sudo ./svc.sh start sudo ./svc.sh status On Linux, svc.sh install takes an optional username argument — pass the dedicated runner user you created, so the service runs as that user rather than root. On macOS, the service installs as a launchd agent for the logged-in user. Check the status after installation, reboot the machine, and confirm the runner comes back online and shows Idle in the GitHub UI. A runner that does not survive a reboot is a runner that will be offline on Monday morning after a weekend of patching.
Healthy runners need routine care. Watch disk space, because build artefacts, Docker images and caches accumulate on a machine that runs job after job, and a full disk is the most common cause of a runner that starts failing jobs for no apparent reason. Schedule a clean-up job — either a workflow that runs on the runner itself or a cron job on the host — that removes old work directories, prunes unused Docker images and clears package caches. Monitor the runner's status in the GitHub UI: Idle, Active and Offline are the states that matter, and a runner that sits Offline after a reboot needs attention before the queue backs up behind it.
Keep the software on the runner current, and keep the runner's own dependencies pinned deliberately. If your workflows need a specific version of Node, Python or the AWS CLI, install it on the runner image and document the version, so a job that passes today does not fail next month because a tool was upgraded underneath it. Better still, build the runner as an image — a virtual machine image or a container image — so that every runner in the fleet is identical and a replacement is a fresh copy of the image rather than a hand-configured machine.
When a runner misbehaves, the logs are on the machine, not in the GitHub UI. The runner writes its own logs into the _diag folder inside the runner directory, and each job writes a log for every step it runs, which you can read in the workflow run view on GitHub. Start with the job log: it shows which step failed and the command that failed. If the runner itself is the problem — it shows Offline, or it never picks up jobs — read the _diag logs, which record the runner's connection attempts, its registration state and its update history. A runner that appears Offline usually has a network problem, an expired registration, or a service that is not running; the diagnostic log distinguishes those three in a few lines, while guessing from the UI takes far longer. Re-registering a runner that has lost its configuration is a normal operation, not a failure: remove it with ./config.sh remove --token YOUR_TOKEN and register it again.
Security: The Rules That Protect Your Machine
Self-hosted runners are powerful and therefore dangerous, and GitHub's documentation is unusually direct about the risk: it recommends using self-hosted runners only with private repositories. The reason is that a fork of a public repository can open a pull request that runs code in a workflow, and that code executes on your runner, on your network, with whatever permissions the runner's environment provides. A malicious workflow could read files from the machine, reach internal services, or exfiltrate secrets. That is not a theoretical risk; it is the documented reason for the recommendation, and it is the first thing to internalise before you add a self-hosted runner to a public repository.
Limit what the runner can reach. The runner machine should not hold production credentials, should not have network access to production databases, and should not share a network segment with anything sensitive. Treat the runner as untrusted compute: give it the minimum network access its jobs need, put it in its own network segment, and assume that any job could be malicious. If a workflow needs a secret, pass it through GitHub's encrypted secrets, scoped to the repository that needs it, rather than storing it on the machine where every job can read it.
Ephemeral runners are the strongest mitigation. An ephemeral runner is configured with --ephemeral at registration, runs exactly one job, and then is automatically removed. Because each job starts from a clean machine, there is no state for a malicious job to poison and no credential for it to steal from a previous run. Ephemeral runners are more work to operate — you need automation that creates a fresh runner for each job and destroys it afterwards — but for public repositories or untrusted workloads they are the correct design, and they are the foundation of the scaling approach in the next section.
Compare that with the Jenkins model many teams already know, where the controller and its agents live on infrastructure the team fully controls and the same trust questions apply in a different shape. Our Jenkins CI/CD pipeline tutorial covers agents, credentials and pipeline security in that world, and the principles transfer: least privilege for the agent, secrets in the credential store rather than on disk, and no agent that can reach production without going through a gate.
Scaling: Ephemeral Runners and Actions Runner Controller
One runner is a hobby; a fleet is an operation. The naive way to scale is to register more long-lived runners and hope the queue stays short, but that leaves machines idle most of the time and creates the state-pollution problem from the earlier sections. The better pattern is to scale the fleet to the queue: create runners when jobs are waiting, destroy them when the queue is empty, and make every runner ephemeral so each job starts clean.
GitHub provides two supported paths. The first is to build your own autoscaling around the runner application, using the webhook events GitHub emits when a workflow job is queued, and a script or service that provisions a runner, registers it with an ephemeral token, and destroys it after the job. The second, and the one most teams should use, is Actions Runner Controller — the Kubernetes-based autoscaling implementation maintained in the actions-runner-controller project. It runs runners as pods inside a Kubernetes cluster, scales the number of pods based on the workflow queue, and removes each pod after its job finishes. The controller is documented in its own repository, and it is the reference implementation GitHub points teams towards for Kubernetes-based scaling. The shape of an ARC deployment is a controller installed in the cluster, a runner scale set that describes the runner image and the labels it carries, and a GitHub App or token that lets the controller listen to the queue — the project's own documentation gives the exact installation steps, and they change often enough that copying them from a tutorial is a mistake.
Whichever path you choose, a few rules apply. Scale on the queue, not on a schedule: a fleet sized for the average load is either idle or overwhelmed, while a fleet that follows the queue is neither. Keep the runner image small and the start-up fast, because a runner that takes five minutes to boot is a runner that adds five minutes to every job's queue time — pre-install the tools your workflows need in the image rather than installing them at start-up. Set a maximum fleet size so that a runaway workflow cannot provision an unbounded number of machines, and alert on the queue depth so you know when jobs are waiting longer than they should. And remember the timing rules from the reference documentation: a job that waits more than 24 hours fails, and a runner that does not pick up an assigned job within 60 seconds loses it to re-queueing, so a fleet that scales too slowly is a fleet that fails jobs.
Frequently Asked Questions
Are self-hosted runners free?
GitHub does not charge for the self-hosted runner application itself — you can use it with GitHub Actions at no additional cost from GitHub. You pay for the machines you run it on, whether that is hardware you own or cloud instances you rent, and for the network and storage those machines use.
Can I use a self-hosted runner with a public repository?
GitHub recommends against it. Forks of a public repository can run code on your runner through a pull request workflow, which can expose the machine and your network. If you must use self-hosted runners with a public repository, use ephemeral runners and isolate the machine from anything sensitive.
What operating systems can run a self-hosted runner?
Ubuntu 20.04 or later, Debian 10 or later, RHEL 8 or later and other listed Linux distributions, Windows 10 and 11 64-bit and Windows Server 2016, 2019 and 2022, and macOS 11.0 (Big Sur) or later. Architectures are x64 everywhere, with ARM64 in public preview. Docker container actions require a Linux runner with Docker installed.
Why is my job stuck in the queue?
Usually because no runner matches the labels the job requested, or every matching runner is offline or busy. Check the runner list for an Idle runner with the right labels, check that the runner is actually online, and remember that a job left queued for more than 24 hours fails. A label typo in the workflow is the most common cause.
How do I keep a runner running after a reboot?
Install it as a service with svc.sh install followed by svc.sh start, run as your dedicated runner user on Linux. Verify it survives a reboot by rebooting the machine and confirming the runner shows Idle in the GitHub UI before you rely on it.
Conclusion
Self-hosted runners trade convenience for control, and the trade is worth it when your jobs need hardware, software or network access that GitHub-hosted runners cannot provide. Start with one machine, register it, run a real workflow on it, and install it as a service under a dedicated user. Add labels deliberately, keep the machine clean and isolated, and never point a long-lived runner at a public repository. When one machine is not enough, move to ephemeral runners and scale on the queue with Actions Runner Controller. The runner is a small piece of software, but the discipline around it — patching, monitoring, least privilege and clean state — is what makes a self-hosted fleet reliable instead of merely available.

