Setting up runners on Windows, Linux and a Mac
The practical half of running CI on your own machines: what each OS needs so a self-hosted runner comes back on its own, stays out of your way, and fails fast when it isn't ready. Windows and Linux are easy. The Mac wants a person.
Lorenzo Wynberg · November 27, 2026 · 7 min read
In My CI runners are a lab I wrote about what my own machines did once they were GitHub Actions runners. This is the short, practical version: how each one is set up, and what I'd do from day one.
It's written mostly for solo developers. With agents, one person can build and ship far more than they could a few years ago, and that person usually has a couple of good machines, a private repo and no budget for paid CI minutes. That's who this is for.
The summary: Windows and Linux come back by themselves. The Mac wants a person.
On every machine
- Keep it to private repos, with people you trust. In a public repo, anyone can fork it, change a workflow and open a pull request, and that code runs on your machine, next to your files and your network. GitHub's own advice is to use self-hosted runners only with private repositories. Private isn't the whole answer either: anyone who can push a branch can run code on your machine, so only give access to people you'd let use it. Mine are all private, and it's a short list. If yours is public, keep pull requests from forks off your runners entirely.
- Give it its own label (
oa-windows,oa-linux,oa-mac), so a job lands there only when something picks it. - Pick the runner up front. A job sent to an offline runner waits forever, with no error. A small first job asks GitHub which runners are online and chooses: an idle one, then a busy one, then a paid runner only when every machine is off.
- Keep the job in its own folder. Point caches, browsers and package stores at a folder inside the runner's work directory that the checkout doesn't wipe. Nothing writes global config.
- Decide on purpose which jobs can write. Most jobs only need to read the repo. The ones that write, like a release that tags and publishes or a re-level that commits new preset levels, run on my machines too, so a token that can push and the release secrets reach them for that job. That's a fine trade for my own code on my own hardware. Grant
contents: writeonly to the jobs that need it, never workflow-wide. - Don't gate twice. The runner is CI. Push, and let the check on the commit be the answer.
Windows
The easiest of the three.
- Run it as a Windows service with automatic start, under your own user account. It comes back after a reboot with nobody signed in. Stopping the service takes the machine out of rotation.
- If it's your daily machine, keep the job tidy. Caches live in the runner's work folder, git settings come from the environment, and a setup step stops anything a cancelled run left behind.
- Put Git's bash first on the PATH. Windows ships a
bash.exestub that launches WSL instead, andshell: bashwill find it first. - Skip what would touch your real install. My installer test installs and uninstalls the plugins system-wide, so on my PC it's skipped, and the run says so. That check only runs on a machine that isn't mine.
Linux, on the same PC
My Linux runner is an Ubuntu under WSL on the Windows PC, so one box is two runners.
- Give CI its own distro. Jobs install what they need with
sudo apt-get, like on a hosted runner, so the runner's user gets passwordlesssudoand nothing of yours lives in there. - Turn on systemd (
/etc/wsl.conf,[boot],systemd=true) and run the runner as a service (sudo ./svc.sh install, thenstart). - Make WSL boot with no login. A Windows scheduled task at startup, running as you, with the action
wsl.exe -d Ubuntu-24.04 --exec /bin/true. Without it, the distro doesn't start until something callswsl, and the runner stays offline until then. - Split the box. Cap WSL's cores and memory in
.wslconfigand cap the Windows build to the rest, so two jobs at once can't starve each other or you. - Expect no GPU. Headless browsers may need to be told to paint on the CPU.
The Mac
The Mac runner is a service too, but a Mac is built for a person sitting in front of it, and the runner has to live with that.
- It starts when you log in, not at boot. After a restart, someone has to log in before the runner is back.
- Fix the service file
svc.shwrites. It setsSessionCreate, which starts the runner in a fresh security session, cut off from your login keychain. Kuentas found this the hard way: its browser tests passed by hand and failed on the runner, because WebKit keeps the key that protects stored crypto keys in the login keychain. DeleteSessionCreate, addKeepAlive, reload the service, and do it with a script, so reinstalling the runner can't quietly put it back. Know what that trades: withoutSessionCreate, every job on that runner can reach your keychain. Do it only for repos whose code you trust. Trinity's runners run code agents wrote, so Trinity leaves it in. - Never let the session lock. A locked session stalls WebKit without an error. Set the Lock Screen to require no password after the screen saver or display sleep.
- Check before every job that needs the screen. Wake the display, confirm the session is unlocked, and load one tiny page in a browser before anything slow starts. A Mac that isn't ready fails in seconds, naming the setting, instead of hours later with a timeout. Jobs that only crunch audio just keep the Mac awake.
- Keep a maintenance workflow. Mine has three actions you run by hand: diagnose (disk, leftover processes, lock and display state, and a test page load), reset (clear browsers and work folders), and keep-awake (hold the display on and the session unlocked for a couple of hours).
Signing on a Mac runner
Trinity and Ozner Audio both sign and notarize on Mac runners, and both learned the same lessons.
- Sign from a keychain you build for the run. Not the login keychain. Make one in the job's temp folder from your secrets, with a random password and no lock timeout (a long build must not lock it). Let
codesignuse the key without asking (-T /usr/bin/codesignon import, thensecurity set-key-partition-list -S apple-tool:,apple:,codesign:), put it first in the search list, pass it tocodesign --keychain, and delete it when the job ends. - Ship Apple's intermediate certificate yourself. A certificate exported without Apple's Developer ID intermediate fails with "unable to build chain to self-signed root". The trap:
security find-identitystill says the identity is valid, because it downloads missing certificates on its own, andcodesignnever does. Import the intermediate into the run's keychain. On a recent macOS, also open it once into the runner's login keychain, because it doesn't reliably read intermediates from a keychain added during the run. - Test-sign in the first minute. A signature on a throwaway file at the start of the job turns a chain problem into a failure in seconds, not one at the end of the build.
- Sign what's inside, not just the app. Tauri signs the outer
.app. The native modules and libraries inside it are yours to sign, with the hardened runtime and a timestamp, or Apple's notary rejects the whole thing. That signing happens before Tauri sets up its own keychain, which is one more reason to build yours in an earlier step. - Notarize with an API key from your secrets, not a keychain profile saved on the machine, and make CI fail if it ever falls back to one. Retry the timestamp: Apple's timestamp server sometimes doesn't answer.
- Keep tests off the login keychain. A test that needs a keychain makes a throwaway one of its own and deletes it after. Anything that could pop up a dialog only runs by hand, behind an opt-in flag.
Windows and Linux had none of this. My Linux jobs never sign, and Windows signing isn't on yet.
Worth it
None of this is hard once you know it, and most of it I only know because something failed first. A paid runner skips most of it. My own machines cost nothing per minute, keep their caches warm, and are the actual hardware my users run. For a project on a budget, that trade is easy.
For what the runners found once they were set up, read My CI runners are a lab.