A cheaper macOS runner for GitHub Actions: self-hosted on a dedicated Mac mini
Hosted macOS minutes are among the most expensive in CI. A dedicated Mac mini as a self-hosted runner costs the same whether you build ten times a day or a thousand. Here's when it pays off and how to set it up.
The cost math
GitHub's standard hosted macOS runner is listed at about $0.062 per minute (check GitHub's pricing page for your plan; larger runners cost more). A flat-price dedicated Mac pays off once you use more than a certain number of minutes a month:
| Build minutes / month | Hosted at $0.062/min | Dedicated M6 runner at $111/mo |
|---|---|---|
| 1,000 | $62 | $111 |
| 1,790 | $111 | $111 (break-even) |
| 5,000 | $310 | $111 |
| 15,000 | $930 | $111 |
Below ~1,800 minutes a month, stay on hosted runners. Above it, a self-hosted Mac is cheaper and usually faster too: caches stay warm on local SSD, and there's no queue.
Setup in a few commands
- In your repo: Settings → Actions → Runners → New self-hosted runner, choose macOS / ARM64.
- On the Mac, run the download commands GitHub shows (they include the current runner version), then register it with a label:
./config.sh --url https://github.com/OWNER/REPO --token YOUR_TOKEN --labels macrent-m6
./svc.sh install # run as a service, so it survives reboots
./svc.sh start
Then point your workflow at it:
jobs:
build:
- runs-on: macos-latest
+ runs-on: [self-hosted, macrent-m6]
steps:
- uses: actions/checkout@v4
- run: xcodebuild test -scheme App -destination 'platform=iOS Simulator,name=iPhone 17'
Get a dedicated Mac with Xcode, ready for your agent
MacRent gives you a whole Mac mini (Xcode, iOS Simulators, Claude Code and Codex preinstalled), always on. Use it from your browser, over SSH or from your phone.
Try it for $12 / 24 hours Early access · monthly from $105 · no charge until your Mac is live · all plansMake it fast and reliable
- Pin Xcode per project with
sudo xcode-select -s /Applications/Xcode-XX.apporDEVELOPER_DIR, so updates never surprise a build. - Keep DerivedData and SPM caches on the local disk. That's the main speed win over fresh hosted VMs.
- Clean between jobs if you build untrusted code. A self-hosted runner should only run your own repos, never public fork PRs.
- No inbound ports needed: the runner connects out to GitHub. The same goes for GitLab, Buildkite and Jenkins agents.
Security: GitHub recommends self-hosted runners only for private repositories, because workflows from public forks could run arbitrary code on your machine.
Get a dedicated Mac with Xcode, ready for your agent
MacRent gives you a whole Mac mini (Xcode, iOS Simulators, Claude Code and Codex preinstalled), always on. Use it from your browser, over SSH or from your phone.
Try it for $12 / 24 hours Early access · monthly from $105 · no charge until your Mac is live · all plansFAQ
When is a self-hosted macOS runner cheaper than GitHub-hosted?
At roughly $0.062 per hosted minute, a $111/month dedicated runner breaks even around 1,800 build minutes a month. Above that, the flat price wins.
Does a self-hosted runner need inbound ports?
No. The GitHub Actions runner connects outbound to GitHub, so the Mac doesn't need to accept incoming connections.
Can I use it with GitLab, Buildkite or Jenkins?
Yes. Their agents work the same way on a Mac: install the agent, register it, and target it from your pipeline.