Best AWS EC2 Instance for CI/CD Runners
For most self-hosted CI/CD runners, **t4g.large** at $0.0672/hr On-Demand or $0.0228/hr Spot (a 66% discount) is the right baseline. Two vCPUs and 8GB of RAM handle parallel test jobs comfortably for most projects, and the burstable CPU model is a perfect fit for CI workloads because builds are by definition bursty: an instance sits idle between commits, accumulating credits, then spends them all in a 5-minute burst when a PR lands.
CI runners are the canonical workload to run on Spot. Each individual job is independent, restartable, and holds no in-memory state worth preserving. When a Spot interruption hits, the orchestrator simply re-queues the job and a new runner picks it up — usually within 60 seconds, often less. The cost savings over On-Demand are dramatic (60-70%), and over GitHub-hosted runners they're even larger. For an active project running 1,000 minutes of CI per day, self-hosted t4g.large Spot runners cost roughly $40/month vs $80-120/month for the equivalent GitHub-hosted minutes.
Graviton (ARM64) is a fine default for CI in 2026, but verify a few things first: the JavaScript toolchain is solid (npm, yarn, pnpm all arm64-native), Rust and Go cross-compile, but watch for vendored binaries in your build process (proto compilers, custom linters, internal CLI tools) that may only ship x86_64. For multi-platform projects, the cleanest pattern is to run all CI on ARM64 and use QEMU emulation for any x86_64-specific test steps — the slight overhead is offset by the Graviton hourly cost savings.
Use ephemeral runners: each job provisions a fresh instance, runs to completion, and terminates. Don't run long-lived runner pools that accumulate dependencies, secrets, and trust over time. The setup cost (startup time, image baking) is real but justified by the security posture. Tools like GitHub Actions Runner Controller or BuildJet make this pattern straightforward to operate, and pairing them with Spot instances gets you the cheapest possible CI infrastructure.
Alternatives by tier
Things to consider
- CI runners are the canonical Spot workload — interruption-tolerant, restartable, no in-memory state to lose
- Self-hosted runners on Spot t4g.large typically cost 60-70% less than GitHub-hosted minutes for the same job throughput
- Most build tools (npm, pip, cargo, go, gradle, maven) support ARM64 fine in 2026 — verify any compiled extensions or vendored binaries
- Use ephemeral runners (spin up per-job, terminate after) for security — long-lived runners accumulate secrets and become attack surface