GitHub self-hosted runners: setup, security and cost
A GitHub self-hosted runner is GitHub’s open source runner application running on a machine you control, picking up GitHub Actions jobs instead of a GitHub-hosted VM. You register it from your repository or organization settings with a one-hour token, run it as a service, and send jobs to it with runs-on labels. Use it only for private repositories, give it a dedicated machine, and know that GitHub-hosted runners are often cheaper once you count your own time.
At a glance
| Item | Current state (checked 2026-12-05) |
|---|---|
| Latest runner release | v2.338.2 (26 October 2026), github.com/actions/runner |
| Operating systems | Linux, Windows (64-bit), macOS 11 or later |
| Architectures | x64; ARM64 in public preview |
| Network | Outbound HTTPS on port 443 only; no inbound ports |
| Registration token | Generated in settings, expires after one hour |
| Update window | 63 days after a newer version, if auto-update is off |
| Offline cleanup | Removed after 14 days offline (ephemeral: 1 day) |
| Job limits | 5 days execution, 24 hours in the queue |
| GitHub’s charge for self-hosted usage | None today; a planned fee was postponed (see cost section) |
For the bigger picture on forges and CI, start at the Git hosting hub.
When GitHub-hosted runners are the better choice
Say it plainly: for many projects a self-hosted runner is the wrong choice.
- Public repositories. Standard GitHub-hosted runners are free there, and self-hosted runners are dangerous there (see security below).
- Light private CI. If your monthly usage fits in your plan’s included compute usage, a self-hosted runner saves nothing and adds a machine to patch.
- Clean builds. GitHub-hosted runners start every job in a fresh VM. A self-hosted runner does not unless you build that yourself.
Self-hosting pays off when you need hardware GitHub does not offer, access to something on your own network, warm local caches, or you run enough private-repository minutes that a dedicated machine costs less than the per-minute rates in the cost table below.
Requirements
GitHub’s reference lists what a runner machine needs:
- A supported OS: Red Hat Enterprise Linux, CentOS or Oracle Linux 8+, Fedora 29+, Debian 10+, Ubuntu 20.04+, Linux Mint 20+, openSUSE 15.2+, SLES 15 SP2+; Windows 10 or 11 64-bit, Windows Server 2016, 2019 or 2022; macOS 11 or later.
- x64, or ARM64 (public preview). The release page also ships a Linux
armbuild. - Outbound HTTPS on port 443 and at least 70 kilobits per second each way.
- Enough CPU, memory and disk for your jobs. The runner itself needs little.
- Linux with Docker installed if workflows use Docker container actions or service containers.
A small VPS works for most builds; see choosing a VPS for self-hosting.
Step 1: generate the commands in GitHub
GitHub builds the setup commands for you, with the current version and a fresh token.
- Repository runner: open the repository, then Settings, Actions, Runners, New self-hosted runner. You must own the repository, or be an organization owner or have admin access for an organization repository.
- Organization runner: organization Settings, Actions, Runners, New runner, New self-hosted runner. Only organization owners can do this.
- Pick the operating system and architecture, then run each command on the runner machine in the order shown.
The token expires after one hour, so generate it when you are ready.
Step 2: download, configure and run
Create an unprivileged user for the runner first. The Linux config.sh refuses to run as root and stops with “Must not run with sudo” unless you set RUNNER_ALLOW_RUNASROOT. Do not set it.
The download step looks like this on the release page for Linux x64 (your settings page shows the current version):
mkdir actions-runner && cd actions-runner
curl -O -L https://github.com/actions/runner/releases/download/v2.338.2/actions-runner-linux-x64-2.338.2.tar.gz
tar xzf ./actions-runner-linux-x64-2.338.2.tar.gz
Register the runner with the URL and token from the settings page, then start it in the foreground to test:
./config.sh --url <REPOSITORY_URL> --token <REGISTRATION_TOKEN>
./run.sh
When the terminal shows “Connected to GitHub” and “Listening for Jobs”, the runner also appears under Runners in settings. On Windows, use C:\actions-runner and an administrator shell if you want the service option.
Step 3: run it as a service
On Linux with systemd, stop run.sh and use the svc.sh script from the runner directory:
sudo ./svc.sh install
sudo ./svc.sh start
sudo ./svc.sh status
The install command takes an optional user argument (./svc.sh install USERNAME) to run the service as a different user. The service is named actions.runner.<org>-<repo>.<runnerName>.service; follow its log with:
sudo journalctl -u actions.runner.octo-org-octo-repo.runner01.service -f
On macOS, run the same svc.sh commands without sudo. On Windows the service is set up during config.
Labels and runs-on
Every runner gets default labels: self-hosted, its OS (linux, windows or macOS) and its architecture (x64, ARM or ARM64). Add your own at registration with --labels; the config script cannot change labels on an existing runner, so use the runner’s settings page or the REST API for that.
./config.sh --url <REPOSITORY_URL> --token <REGISTRATION_TOKEN> --labels gpu,x64,linux
In a workflow, labels are cumulative: the runner must have all of them.
runs-on: [self-hosted, linux, x64, gpu]
Organizations can also route by runner group:
runs-on:
group: build-runners
Labels are case-insensitive. If nothing matches, the job waits in the queue and is cancelled after 24 hours.
Ephemeral runners and autoscaling
A normal runner keeps its working directory between jobs, so one job can leave files, processes or credentials for the next. An ephemeral runner takes exactly one job and is then de-registered:
./config.sh --url https://github.com/octo-org --token example-token --ephemeral
Your automation then wipes the machine and registers a new one. GitHub recommends ephemeral runners for any autoscaling and asks you to forward runner logs elsewhere first, since the machine disappears. For stronger registration security, the REST API can create just-in-time runners, started with ./run.sh --jitconfig ${encoded_jit_config}.
At larger scale on Kubernetes, GitHub recommends Actions Runner Controller (ARC), an operator that creates ephemeral runner pods as jobs arrive. Outside Kubernetes, GitHub’s Runner Scale Set Client is the building block for custom autoscaling.
If you bake the runner into a container image, --disableupdate stops self-updates. You must then update within 63 days of a new version, or GitHub stops sending jobs.
Networking
The runner only makes outbound HTTPS connections: it connects out to GitHub to receive job assignments, so no port forwarding is needed. For a strict egress firewall, GitHub’s reference lists the domains by function: github.com, api.github.com and *.actions.githubusercontent.com for essential operations, plus domains for action downloads, logs and artifacts, runner updates, GitHub Packages and Git LFS. If your organization uses an IP allow list, add the runner’s IP address. Note that Docker Hub pulls from self-hosted runners always count against Docker Hub’s rate limit.
There is no web admin panel on the runner. Manage the machine over SSH behind a VPN or IP allowlist, keep the OS patched, and do not bother backing it up: a lost runner is re-registered in minutes.
Security: never on public repositories
GitHub’s hardening guide explains the core problem. GitHub-hosted runners run each job in a clean, ephemeral VM, so there is no way to compromise them persistently. Self-hosted runners have no such guarantee and “can be persistently compromised by untrusted code in a workflow”. That is why GitHub says they should almost never be used for public repositories: any user can open a pull request against the repository, and that pull request’s workflow code runs on your machine.
The same applies, more narrowly, to private repositories: anyone who can fork and open a pull request, usually anyone with read access, can compromise the runner, including its secrets and a GITHUB_TOKEN that may have write access. Environments with required reviewers protect secrets, but not the runner.
Fork approval settings do not fix this. GitHub warns that when someone bypasses or gets approval, their code runs automatically on your self-hosted runner, and that “first-time contributor” rules can be passed with a merged typo fix. Workflows on pull_request_target always run, regardless of approval settings. Since 2 December 2026 GitHub blocks them by default in affected public repositories on Free, Team and Enterprise Cloud, unless an Actions event policy explicitly allows the event; private and internal repositories are not affected.
Practical rules from GitHub’s docs:
- Restrict where runners exist. Organization owners can allow repository-level runners for all, selected or no repositories.
- Use runner groups. Organization runners can serve many repositories, so one compromise spreads. Every organization has a default group; Team plan organizations can create more and limit them to selected repositories. Public repositories cannot use group runners by default; leave that off.
- Keep secrets off the machine. No SSH keys or API tokens in the runner’s home. Prefer OpenID Connect for short-lived cloud credentials. Secrets passed as command-line arguments can be seen by other jobs on the same runner with
ps. - Isolate the network. Run the runner in a dedicated VM with no route to internal services or cloud metadata endpoints.
- Run as a normal user, never as root or an administrator where you can avoid it, and prefer ephemeral runners.
Cost: what GitHub charges today
GitHub’s billing docs, checked 5 December 2026, say self-hosted runners are free and do not reduce your plan’s included compute usage. Standard GitHub-hosted runners are also free in public repositories. Private-repository use of hosted runners draws from a monthly included amount, expressed in dollars, and is billed per minute after that.
| Item (GitHub’s official rates) | Rate or amount (USD) | Notes |
|---|---|---|
| Self-hosted runner usage | Free | Billing docs; you pay for the machine |
| Planned platform charge for self-hosted runners | $0.002 per minute | Announced 16 Dec 2025 for private repos from 1 Mar 2026; postponed (undated notice), no new date |
| Linux 1-core x64 hosted | $0.002 per minute | actions_linux_slim |
| Linux 2-core x64 hosted | $0.006 per minute | actions_linux |
| Linux 2-core arm64 hosted | $0.005 per minute | actions_linux_arm |
| Windows 2-core x64 hosted | $0.010 per minute | actions_windows |
| macOS 3- or 4-core hosted | $0.062 per minute | actions_macos |
| Included compute, Free and Free for organizations | $12 per month | Private repos |
| Included compute, Pro and Team | $18 per month | Private repos |
| Included compute, Enterprise Cloud | $300 per month | Private repos |
Prices checked 2026-12-05 on GitHub’s Actions billing and runner pricing docs and the GitHub Changelog. Hosted rates already include the platform charge and took effect on 1 January 2026, when GitHub cut hosted prices by up to 39%. Jobs are rounded up to whole minutes.
To compare, estimate your private-repository minutes per month by runner type, multiply by the rates in the table above, and subtract the included amount. Then put your VPS or hardware, power and storage into the self-hosting cost calculator. If the two numbers are close, stay on GitHub-hosted runners: your maintenance time is not free, and the postponed fee may return.
If you host your own forge instead
If the goal is to keep code and CI off GitHub entirely, a self-hosted forge has its own runners. The Gitea Actions runner guide covers the closest equivalent, with GitHub-style workflows on your own Gitea, and self-hosted GitLab covers GitLab’s runner model.
Frequently asked questions
- Are GitHub self-hosted runners free?
- As of 5 December 2026, GitHub's billing docs list self-hosted runners as free: their usage does not reduce your plan's included compute usage. On 16 December 2025 GitHub announced a per-minute cloud platform charge for self-hosted usage in private repositories from 1 March 2026, then postponed it to re-evaluate its approach, without giving a new date. You still pay for the machine, power and your own time.
- Can I use a self-hosted runner on a public repository?
- GitHub says self-hosted runners should almost never be used for public repositories, because anyone can open a pull request whose workflow runs code on your machine and can compromise it persistently. Standard GitHub-hosted runners are free for public repositories, so there is rarely a reason to take that risk.
- Do I need to open ports on my firewall?
- No inbound ports are needed. The runner makes outbound HTTPS connections on port 443 to GitHub and asks for jobs. It needs at least 70 kilobits per second up and down and access to the GitHub domains listed in the self-hosted runners reference.
- What happens if I turn off automatic runner updates?
- You must then update the runner yourself within 63 days of a newer version becoming available. After that, GitHub stops assigning jobs to it, and for a critical security update it stops sooner, until you update.
- Why does my job stay queued?
- No online, idle runner has every label (and the group) listed in runs-on. Labels are cumulative and case-insensitive. A job that stays queued for 24 hours is cancelled automatically.
Sources, checked December 5, 2026
- GitHub Docs: Self-hosted runners (concepts)
- GitHub Docs: Self-hosted runners reference (requirements, autoscaling, updates, communication)
- GitHub Docs: Adding self-hosted runners
- GitHub Docs: Configuring the self-hosted runner application as a service
- GitHub Docs: Using labels with self-hosted runners
- GitHub Docs: Using self-hosted runners in a workflow
- GitHub Docs: Monitoring and troubleshooting self-hosted runners
- GitHub Docs: Removing self-hosted runners (automatic removal after 14 days)
- GitHub Docs: Managing access to self-hosted runners using groups
- GitHub Docs: Secure use reference (hardening for self-hosted runners)
- GitHub Docs: Managing GitHub Actions settings for a repository (fork pull request approval)
- GitHub Docs: Actions Runner Controller
- GitHub Docs: Actions limits
- GitHub Docs: GitHub Actions billing
- GitHub Docs: Actions runner pricing
- GitHub Changelog: Update to GitHub Actions pricing (16 December 2025, with postponement notice)
- GitHub Changelog: Reduced pricing for GitHub-hosted runners usage (1 January 2026)
- GitHub Changelog: pull_request_target enforcement begins December 2 (2026)
- actions/runner repository and README
- actions/runner releases (v2.338.2 latest)
- actions/runner config.sh (refuses to run as root)
- actions/actions-runner-controller repository