Skip to content
Go back

Why Self-Hosted GitHub Actions Runners on AWS Cost More Than the EC2 Bill

Aniket Maurya

An EC2 Spot instance looks roughly 8x cheaper per minute than a GitHub-hosted runner. On a real workload of 1 million CI minutes a week across mixed 2, 4, and 8 vCPU jobs, raw EC2 Spot compute plus root disks lands at $1,135 a week, compared to $10,500 a week on GitHub-hosted runners.

Then the full AWS invoice arrives. NAT Gateway data fees, internet egress, spot-interruption reruns, warm-pool idle time, and control-plane services push that same self-hosted AWS setup to roughly $1,730 to $2,100 a week, before anyone counts engineer hours.

At that point, you pay more than a low-cost managed runner like Celesto CI ($1,200 a week for the same 1 million minutes), while you still own every outage at 2 AM.

Here is where the extra money goes, based on AWS US East (us-east-1) list prices checked on December 3, 2026:

Hidden AWS line itemAWS list price (us-east-1)Why teams miss it in spreadsheets
NAT Gateway (hourly + data)$0.045/hr per AZ + $0.045/GB processedEvery git clone, npm install, Docker pull, and cache transfer pays per GB
Internet egress$0.09/GB after 100 GB/mo free tierArtifacts, container pushes, and GitHub cache uploads leave AWS
Public IPv4 (if you skip NAT)$0.005/hr per in-use IPv4 addressAdds up across hundreds of ephemeral runners and exposes public IPs
Spot reclaims + boot/idle overhead2-minute reclaim notice; 10% to 20% wasted minutesJobs cannot checkpoint and resume; one failed 12-minute test costs 22 minutes
Storage, logs, and control planegp3 $0.08/GB-mo, S3 $0.023/GB-mo, CloudWatch $0.50/GBAlways-on autoscaler, AMI snapshots, and verbose build logs never hit $0

If you only need the short answer, stop there: compare your total AWS CI bill plus engineer maintenance, not the EC2 Spot hourly rate. If you want the architecture breakdown, the spot failure modes, and the full 1-million-minute spreadsheet, read on. Each section goes one layer deeper.

What is a self-hosted GitHub Actions runner?

When you push a commit to GitHub, GitHub Actions runs your workflow YAML on a virtual machine called a runner. You have three ways to supply that machine:

Self-hosted runners look irresistible on paper because GitHub charges $0 for self-hosted minutes today, and an m8a.large Spot instance costs fractions of a cent per minute.

The trap is that a CI job is not pure CPU. It is a network-heavy, disk-heavy, bursty workload that starts and stops thousands of times a day.

Five AWS charges that never show up in an EC2 spot calculator

Most teams estimate self-hosted CI with one formula: monthly minutes x EC2 spot rate. That formula omits the rest of the AWS VPC that keeps ephemeral runners alive and reachable.

Architecture diagram of a self-hosted GitHub Actions runner fleet on AWS that maps where NAT Gateway fees, internet egress, EBS gp3 storage, S3 cache, CloudWatch logs, and spot reclaims add cost.

1. NAT Gateway hourly and per-GB data fees

Security best practice puts CI runners in private subnets so arbitrary build jobs do not sit on public IP addresses. Private subnets reach GitHub, npm, PyPI, and Docker Hub through a NAT Gateway.

In us-east-1, AWS VPC charges $0.045 per hour per NAT Gateway (about $32.40 a month per Availability Zone, or $64.80 a month across two AZs) plus $0.045 for every GB of data that passes through it, in either direction.

Notice that last part: both inbound downloads and outbound uploads count. Every Docker base image pull, every node_modules download, every git clone, and every cache restore through GitHub pays $0.045/GB. If 200,000 weekly jobs average 50 MB of internet traffic each, that is 10 TB a week through your NAT Gateways, or $450 a week in NAT data fees alone.

You can skip NAT Gateways and put ephemeral runners in public subnets with strict security groups (this is the default in tools like RunsOn). That saves the $0.045/GB NAT data fee, at two costs: AWS charges $0.005 per hour for every in-use public IPv4 address (AWS VPC), and your security team has to sign off on public-subnet CI instances.

2. Internet egress and cross-AZ data transfer

AWS gives you 100 GB of internet egress free per month across your entire account. After that, EC2 Data Transfer Out starts at $0.09 per GB in us-east-1.

Inbound downloads from npm or Docker Hub are free on the egress meter (though they still pay the NAT Gateway per-GB fee). Outbound traffic is not free. Every Docker image push to GHCR or Docker Hub, every GitHub Actions artifact upload, every test report, and every actions/cache upload back to GitHub’s Azure storage leaves AWS at $0.09/GB.

Cross-AZ traffic inside your own VPC also costs $0.01 per GB each way. If your runner in us-east-1a talks to a shared build cache or NAT Gateway in us-east-1b, AWS meters every byte twice.

3. EBS gp3 volumes, AMI snapshots, and S3 caches

Every ephemeral runner needs a root volume, usually 30 GB to 100 GB of gp3 storage, billed at $0.08 per GB-month in us-east-1 (AWS EBS) with a 60-second minimum. If you raise baseline throughput above 125 MB/s (common for fast Docker layer extraction), AWS adds $0.04 per provisioned MB/s-month.

To avoid $0.09/GB egress to GitHub’s cache service, most AWS runner setups intercept actions/cache and store archives in an in-region S3 bucket. S3 Standard costs $0.023 per GB-month plus PUT and GET request fees, and you still pay for your custom AMI snapshots every month.

4. CloudWatch Logs and an always-on control plane

Your autoscaler (a fleet of Lambdas, SQS queues, Step Functions, or an EKS cluster with Actions Runner Controller) runs 24/7 even when nobody pushes code on Sunday night.

Verbose runner bootstrap logs, autoscaler traces, and VPC Flow Logs flow into Amazon CloudWatch, where log ingestion costs $0.50 per GB in us-east-1 before retention storage. One noisy debug flag on a busy fleet can burn hundreds of dollars before anyone checks Cost Explorer.

5. Boot, teardown, and warm-pool idle minutes

GitHub bills a job only while the job runs. AWS bills an EC2 instance from the moment it enters running until termination completes, with a 60-second minimum on Linux.

Cold boot, cloud-init, runner registration, and teardown easily add 30 to 60 seconds to every short job. If you keep a warm pool of idle instances so developers do not wait 90 seconds for a VM to boot, you pay for every idle minute those machines sit empty between commits.

Across a real fleet, boot, teardown, warm-pool slack, and spot reruns commonly add 10% to 20% on top of your GitHub job minutes.

Why EC2 spot instances make your CI test suite flaky

The cheapest AWS CI spreadsheets always assume EC2 Spot instances. Spot discounts are real (often 60% to 75% off On-Demand), and AWS makes the trade-off explicit in its documentation.

When AWS needs capacity back, EC2 emits a Spot Instance interruption notice two minutes before termination, on a best-effort basis.

Two minutes is enough to drain a stateless web server behind a load balancer. It is useless for a GitHub Actions job.

A CI job cannot pause mid-pytest, serialize its filesystem and Docker daemon, and resume on another host. When EC2 reclaims the instance, the runner dies mid-step and GitHub marks the job failed or cancelled.

Here is what happens next on a real team:

  1. Engineers blame the test suite. The GitHub UI shows a red check, not “AWS reclaimed m8a.xlarge in us-east-1c.” Someone wastes 20 minutes on a phantom flake before they spot the runner disconnect.
  2. You pay for the job twice. If a 12-minute end-to-end suite dies at minute 10, you pay AWS for 10 dead minutes plus 12 fresh minutes on the retry, and the developer waits 22 minutes for a merge signal.
  3. Spot capacity dries up in bursts. Monday morning deploys and end-of-sprint freezes are the exact moments everyone else requests compute too. You end up with fallback logic to On-Demand instances, which wipes out the Spot discount during your busiest hours.

The Docker Hub rate-limit surprise

Even when Spot capacity holds, shared outbound IPs introduce a second class of random failures.

Docker Hub caps unauthenticated pulls at 100 pulls per 6 hours per IPv4 address. Put 50 self-hosted runners behind one NAT Gateway, and your entire org shares one IPv4 address. By 10 AM on a Tuesday, every container build fails with 429 Too Many Requests.

The fix is another piece of infrastructure to build and operate: a pull-through registry mirror in ECR, paid Docker Hub seats wired into every runner AMI, or per-job registry credentials rotated across every repository.

The operational work you inherit on day two

The AWS bill is only half of the total cost. The other half is the maintenance contract you sign with yourself.

A real bill at 1 million CI minutes a week: AWS spot vs. managed runners

Let us put real numbers on a mixed-size CI workload. Take a fleet at 1,000,000 CI minutes per week (~200,000 jobs/week at a 5-minute average, ~100 average concurrent runners):

All provider list prices below were checked against official pages (GitHub Actions, Blacksmith, RunsOn, AWS us-east-1, and Celesto CI):

Option2 vCPU / 8 GB4 vCPU / 16 GB8 vCPU / 32 GBWeekly computeAdded AWS / license feesEstimated weekly total
GitHub-hosted$0.006/min$0.012/min$0.022/min$10,500$0$10,500 / wk
Blacksmith$0.004/min$0.008/min$0.016/min$7,200$0$7,200 / wk
DIY AWS Spot (private subnets + NAT)~$0.0007/min*~$0.0013/min*~$0.0022/min*$1,135~$963 (NAT, egress, +15% waste, logs/S3)~$2,098 / wk + eng time
DIY AWS Spot (public subnets + IPv4)~$0.0007/min*~$0.0013/min*~$0.0022/min*$1,135~$594 (IPv4, egress, +15% waste, logs/S3)~$1,729 / wk + eng time
RunsOn (AWS Spot, public subnets + S3)~$0.0007/min*~$0.0013/min*~$0.0022/min*$1,135~$669 (€3,600/yr tier + AWS overhead)~$1,804 / wk
Celesto CI$0.00067/min$0.00133/min$0.00267/min$1,200$0 (cache included, no egress fee)$1,200 / wk

*EC2 Spot reference rates use RunsOn’s published 7-day us-east-1 averages with a 30 GB gp3 root disk (m8a.large, m8a.xlarge, c8id.2xlarge). Free monthly tiers on GitHub (2,000 to 3,000 min/mo) and Blacksmith (3,000 min/mo) are negligible at 1,000,000 min/week. The DIY AWS estimate assumes 15% boot/teardown/rerun waste ($170/wk), 10 TB/wk through two NAT Gateways ($465/wk) or ~19,167 public IPv4 instance-hours ($96/wk), 3 TB/wk internet egress ($268/wk), and $60/wk for control plane, S3 cache, snapshots, and CloudWatch.

Look at the spread between line 3 and line 6. Raw EC2 Spot compute ($1,135/week) is only $65/week below Celesto CI ($1,200/week). Once you add the VPC infrastructure that AWS bills separately, self-hosted AWS costs 44% to 75% more than Celesto CI, before you price a single hour of engineer time.

What if your team is 20x smaller?

Divide the table by 20 for a team at 50,000 CI minutes a week (about 215,000 minutes a month):

When self-hosted AWS runners still win (and where Celesto does not fit)

Honesty matters here. Self-hosted AWS runners (DIY or via RunsOn) are still the right choice in three concrete situations:

  1. Private VPC access: Your CI jobs must reach an internal RDS database, private Artifactory, or internal microservice that cannot be exposed over the internet.
  2. Strict data residency or compliance: Your security policy forbids source code or build artifacts from ever entering a third-party compute account.
  3. Heavy AWS credits or Enterprise Discount Program (EDP) burn: You have unused AWS credits that effectively zero out your EC2, NAT, and egress charges.

Celesto CI focuses on Linux x64 (Ubuntu 24.04) runners from 1 vCPU / 2 GB (celesto-micro at $0.00025/min) up to 8 vCPU / 32 GB (celesto-xl at $0.00267/min), with built-in actions/cache and Docker Buildx type=gha layer cache included at no extra storage fee.

Because runs-on is chosen per job, you can move standard Linux jobs to Celesto and keep private-VPC or non-Linux jobs on your existing runners without an all-or-nothing migration.

Test one workflow before you build an AWS runner fleet

Before you write Terraform for an EC2 Spot autoscaler, move one noisy Linux job to Celesto CI and compare the actual runtime and bill for a week.

Install the Celesto CI GitHub App, connect a workspace (eligible workspaces start with a one-time $5 trial credit, enough for up to 20,000 celesto-micro minutes), and change one line in your workflow:

jobs:
  test:
    # Match a 2 vCPU / 8 GB GitHub ubuntu-latest runner
    runs-on: celesto-memory
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm
      - run: npm ci
      - run: npm test

Your logs, status checks, and artifacts stay inside GitHub Actions. If you want a direct size-by-size breakdown before you test, check the Celesto CI docs, Celesto vs. GitHub Actions, or Celesto vs. RunsOn.

Frequently asked questions

Are self-hosted GitHub Actions runners on AWS actually cheaper than GitHub-hosted?

Usually yes compared to GitHub-hosted ($0.006/min for 2 vCPU), once you run tens of thousands of minutes a month. Compared to low-cost managed runners like Celesto CI ($0.00067/min for 2 vCPU / 8 GB), self-hosted AWS often costs more after you include NAT Gateways, internet egress, spot reruns, and engineer maintenance.

How can I avoid AWS NAT Gateway charges on self-hosted CI runners?

Place ephemeral runners in public subnets with inbound traffic blocked by security groups, and route dependency caches to an in-region S3 bucket through a free S3 VPC Gateway Endpoint. You still pay $0.005/hr per public IPv4 address and $0.09/GB for outbound internet egress beyond 100 GB/month.

Does GitHub charge per minute for self-hosted runners?

Not right now. GitHub announced a $0.002/minute cloud platform charge for self-hosted runners in December 2025, then postponed it indefinitely to re-evaluate its approach. Treat it as a future budget risk rather than a guaranteed permanent $0 line item.

Why do EC2 Spot instances cause flaky CI tests?

AWS can reclaim a Spot instance with only two minutes of best-effort warning. Because GitHub Actions jobs cannot checkpoint state and move mid-run, any test suite active on that VM terminates abruptly and shows up as a failed build until someone reruns it.


Share this post on:

Previous Post
GitHub Actions Runners Compared: Celesto CI vs. GitHub, Blacksmith, and RunsOn
Next Post
5 Tips to Reduce CI Time When You Code with AI Agents