How to Use Ephemeral Runners to Control Cost
An ephemeral runner exits after one job, so it never lingers idle and never carries state that inflates the next run.
Pass --ephemeral at registration. Paired with an autoscaler, this gives clean, cost-predictable capacity that appears for a job and disappears after.
Steps
- Register the runner with
--ephemeral. - Let it pick up exactly one job, then exit.
- Have the autoscaler replace it only when the queue needs it.
Register an ephemeral runner
Terminal
./config.sh --url https://github.com/my-org \
--token "$RUNNER_TOKEN" \
--ephemeral \
--name "runner-$(hostname)" \
--labels linux,ephemeral
./run.sh # process exits cleanly after one jobGotchas
- Ephemeral runners lose their cache between jobs; use a shared cache backend to keep hit rates up.
- Each cold start reinstalls tools, so bake a custom image to avoid paying setup time every job.
- Non-ephemeral runners can leak state and secrets across jobs, a security cost as well as a compute one.
Related guides
How to Scale Runners to Zero to Cut Idle CostEliminate idle self-hosted runner cost by scaling the fleet to zero when no jobs are queued, using an autosca…
How to Use Spot Instances for Self-Hosted RunnersCut self-hosted GitHub Actions runner cost with cloud spot instances, which are much cheaper than on-demand b…