Quickstart: firerunner on AWS
This guide puts a control VM and ephemeral EC2 runners in your AWS account. To run Firecracker on your own KVM hosts, follow the README.
firerunner is early. Pin the version you deploy, and expect changes.
Before you start
You need:
- an AWS account, with the AWS CLI signed in;
- a GitHub organization where you can create and install a GitHub App;
- a clone of FirerunnerHQ/firerunner.
Spot tiers in a new account need the Spot service-linked role. Create it once:
aws iam create-service-linked-role --aws-service-name spot.amazonaws.com
1. Create the GitHub App
Create a GitHub App in your organization. Disable its webhook, and grant one permission: Organization → Self-hosted runners: Read & write.
Generate a private key, then install the App on the repositories that will use the runners. Keep its client ID and installation ID for step 4.
2. Create the network
aws cloudformation deploy --stack-name firerunner-network \
--template-file deploy/cloudformation/network.yaml
aws cloudformation describe-stacks --stack-name firerunner-network \
--query 'Stacks[0].Outputs'
The outputs give you VpcId, SubnetIds and RunnerSecurityGroupId.
3. Build the runner AMI
The build takes about 20 minutes and publishes the image ID to an SSM parameter. It installs the standard image unless you ask for another.
images/build-ec2-ami.sh \
--subnet subnet-0aaa… --security-group sg-0bbb… \
--ssm-param /firerunner/ami/runner
4. Put the configuration in SSM
Create tiers.json. Developers select this tier with runs-on: firerunner-ubuntu-24.04-4.
[
{
"name": "firerunner-ubuntu-24.04-4",
"provisioner": "ec2",
"min": 0,
"max": 40,
"ec2": {
"instance_types": ["c8a.xlarge", "c7a.xlarge", "m8a.xlarge"],
"ami": "/firerunner/ami/runner",
"subnets": ["subnet-0aaa…", "subnet-0bbb…"],
"security_groups": ["sg-0ccc…"],
"market": "spot-then-on-demand"
}
}
]
Create env with your organization URL and App IDs:
FR_URL=https://github.com/YOUR_ORG
FR_APP_CLIENT_ID=...
FR_APP_INSTALLATION_ID=...
Then store them:
aws ssm put-parameter --name /firerunner/control/env --type String --value "$(cat env)"
aws ssm put-parameter --name /firerunner/control/tiers --type String --value "$(cat tiers.json)"
aws ssm put-parameter --name /firerunner/control/app-private-key --type SecureString --value "$(cat app.pem)"
5. Create the control VM
Choose an Owner that names this install, and never change it. A replacement VM finds its pool through that tag.
aws cloudformation deploy --stack-name firerunner \
--template-file deploy/cloudformation/control.yaml \
--capabilities CAPABILITY_IAM --parameter-overrides \
Owner=acme-prod VpcId=vpc-... SubnetIds=subnet-a,subnet-b \
RunnerSecurityGroupId=sg-...
The first VM fails its boot until the next step sets a version. That is expected.
6. Deploy a release
Use the latest release tag:
deploy/cloudformation/deploy-control.sh firerunner v0.1.5
7. Run a job
Change one job’s label and push:
jobs:
test:
runs-on: firerunner-ubuntu-24.04-4
The runner image
The standard image holds the tools of GitHub’s ubuntu-24.04 that jobs commonly use, and jobs run as runner with sudo, as they do on ubuntu-latest. setup-* actions fetch versions it does not keep. It leaves out rarer stacks, such as Android, Haskell and Swift.
To keep Docker’s data in memory, set "docker_storage": "memory" on a tier and use an image built from v0.1.0 or later. From v0.1.2, an instance with about 32 GiB or more keeps it uncompressed on tmpfs. A large image build took 304 s on r8a.xlarge. On 16 GB it is compressed, and took 381 s instead of 557 s, but it used nearly all of the memory, and a build that outgrows memory fails where the disk would have held it. Docker starts empty, without images baked into the AMI.
To serve repeat git fetches from your VPC, set "cache": true and "git_cache": true on a tier, deploy with Cache set to disk or s3, and use an image built from v0.1.1 or later. A repeat 200 MB fetch took 3–6 s instead of 20 s. A commit’s first fetch still comes from GitHub, and repository contents enter the cache. Install the GitHub App on every repository the tier serves, and run firerunner doctor to check.
For nearly everything GitHub ships, build with --toolset full, which takes 44 GiB. For the smallest image, use --toolset minimal, which has Docker and git, and runs jobs as root.
If something fails
Open a session on the control VM with aws ssm start-session --target <instance>, then read journalctl -u firerunner. The deployment guide covers boot failures and replacement loops.
firerunner doctor --json checks the AMI, subnets, credentials and GitHub access.
Removing it
Delete firerunner, then firerunner-network. The control VM writes its own A record into the stack’s private zone, so delete that record first, or delete-stack fails on the zone (#152).