# Install forkrail

> One command, `forkrail install`, sets forkrail up in an AWS account. It checks the account first, changes nothing until the checks pass, and picks up where it stopped if you run it again.

- Category: Get started
- URL: https://www.forkrail.com/docs/install

## Get the CLI

**macOS and Linux**

```bash
curl -fsSL https://forkrail.com/install | sh
```

**Windows (PowerShell)**

```bash
irm https://forkrail.com/install.ps1 | iex
```

The script downloads the newest release from GitHub, checks it against its SHA-256, and puts `forkrail` in `~/.local/bin` (set `FORKRAIL_BIN` to choose another folder). It runs on macOS (Apple silicon and Intel), Linux (x86_64 and arm64) and Windows (x64 and Arm64). The macOS builds are signed and notarized by Apple.

**On a Mac without Terminal:** download Forkrail.dmg from `forkrail.com/download/mac`, drag Forkrail to Applications and open it. The app is the same installer with its page in a window of its own. AWS and GitHub sign-in still open in your browser, where passkeys work.

## What you need

| Requirement | Details |
| --- | --- |
| An AWS account | Sign in as an administrator or the root user: the install creates roles, keys and servers. The root user needs an MFA device first (IAM → Security credentials → Assign MFA device; a passkey takes a minute). The installer signs you in itself, so the AWS CLI isn’t needed. A computer already signed in (`aws login`, `aws sso login`, an access key, CloudShell) is used as it is. |
| A domain on Cloudflare DNS | The free plan is enough. Apps get `<project>.<domain>` and the dashboard `dashboard.<domain>`. The installer adds one record, `*.<domain>`, and never touches records it didn’t make. |
| A Cloudflare API token | With DNS edit and zone read on that domain. The setup page has a button that opens Cloudflare with the token filled in: click **Continue to summary**, then **Create Token**, and paste it. |
| A GitHub account | The installer creates a GitHub App for your install. Your team signs in to the dashboard with it, and it reads repositories you choose to deploy. |
| An email address (optional) | For alerts: the monthly budget and certificate problems. |

### If your domain’s DNS is somewhere else

The installer asks where your DNS is first. If it’s at GoDaddy, Namecheap, Route 53 or anywhere else, it shows how to move it and stops before changing anything. The domain stays registered where it is; only its DNS moves.

1. **Add the domain to Cloudflare**

   Use the free plan.

2. **Change the nameservers**

   Where you bought the domain, replace its nameservers with the two Cloudflare shows.

3. **Run the installer again**

   When Cloudflare says the domain is active (usually within an hour), run `forkrail install` again.

## Run the installer

```bash
forkrail install
```

Everything you do happens in the first few minutes:

1. **Sign in to AWS**

   Click **Sign in to AWS** on the page. AWS’s sign-in page opens in your browser. Sign in to the account forkrail goes in.

2. **Answer the questions**

   Where your DNS is, the domain, the AWS region (US East, N. Virginia unless you pick another), an alert email and the Cloudflare token.

3. **Wait for the checks**

   The installer checks the account’s limits and the token. Nothing is created until they pass.

4. **Create the GitHub App**

   Click **Create the GitHub App**. GitHub opens with the app filled in: click **Create GitHub App**. If GitHub asks you to confirm your password or passkey and then shows an empty form, click the page’s button again.

Then it sets everything up on its own and shows each step as it runs. The release (about 1 GB: the router, the functions, the builder image and the dashboard) is copied from GitHub straight into your account by a short-lived function there, so nothing that size goes through your connection.

When it finishes, open `https://dashboard.<your domain>` and sign in with GitHub.

### On a server, or from a script

Over SSH the same questions come in the terminal, and AWS sign-in prints an address to open on your phone or laptop. `--terminal` keeps everything in the terminal anywhere. For a run with no one to answer:

```bash
FORKRAIL_CLOUDFLARE_TOKEN=... forkrail install --yes \
  --domain example.com --region us-east-1 --email you@example.com

# Only run the checks, change nothing
forkrail install --check
```

## What it creates

Everything is made with CloudFormation stacks named `forkrail-*` and tagged `project=forkrail`. Steps that don’t depend on each other run side by side.

| Part | What it is |
| --- | --- |
| Bucket | `forkrail-artifacts-<account>`: packages, static files, build logs and state. |
| Encryption keys | AWS KMS keys for environment variables and the install’s own secrets. |
| Roles | IAM roles for the router, the log server, the dashboard and your apps, each allowed only what it needs. |
| Router | A t4g.small EC2 server with a fixed address. It takes every request, gets certificates from Let’s Encrypt, and runs apps on Lambda. |
| Log server | ClickHouse on a t4g.medium with a 50 GB disk, for request logs, app output and Web Analytics. |
| Services | Lambda functions for builds, deploys, notifications, image optimization and page screenshots, plus DynamoDB tables, queues and schedules. |
| DNS record | `*.<domain>`, pointed at the router. |
| Dashboard | Deployed as a forkrail project at `dashboard.<domain>`. |
| Spend protection | An AWS Budget on everything forkrail runs (see below). |
| GitHub App | Your install’s own app, with its keys stored encrypted in your account. |

## What it costs

forkrail itself is free. The servers it runs on are billed by AWS. A fresh install in one region costs about **$1.80 a day** before any traffic (us-east-1 prices):

| Item | About |
| --- | --- |
| Router (t4g.small with a fixed address) | $0.45 a day |
| Log server (t4g.medium, 50 GB disk) | $0.90 a day |
| Public addresses, disks, keys, the audit trail | $0.45 a day |
| Your apps: Lambda, S3, data transfer | What they use. Idle apps cost nothing. |

The install also creates an AWS Budget of $150 a month on everything it runs (`FORKRAIL_INSTALL_BUDGET=300` changes it). At 100% it stops forkrail’s functions, so a runaway bill can’t happen, and AWS emails you at 80% and 100%. Inside forkrail, the team’s [spend limit](https://www.forkrail.com/docs/spend-budgets) starts at $20 a month. [Pricing and costs](https://www.forkrail.com/docs/pricing) has the full breakdown.

## If something fails

Each AWS call is tried twice. If it still fails, the installer stops and prints what it was doing, what went wrong in plain words, how to fix it, and AWS’s own message. Run `forkrail install` again to continue from that step; the steps before it are kept.

| Message | What to do |
| --- | --- |
| “You must have a multi-factor authentication (MFA) device configured” | You signed in as the root user without MFA. Add an MFA device, sign out of the AWS console, and run the installer again. |
| “AWS is still verifying this new account” | New accounts can’t start servers for a while. Wait for AWS’s email, then run it again. |
| Function memory limited to 512 MB | Some new accounts start with a lower Lambda memory limit. Nothing stops: every function is sized to fit and the dashboard shows the limit under Infrastructure. A free support case asking for 10,240 MB raises it sooner. |
| vCPU limit | The two servers need 4 vCPUs. The check links to Service Quotas to ask for 8. |
| Cloudflare token | The token can’t edit the zone, or the zone isn’t active yet. The check says which. |

The installer never asks AWS for more Lambda concurrency. A new account’s starting limit is enough to begin with, and AWS raises it as the account is used.

## Change your answers

Run the installer again. The page shows your previous answers and you can change any of them. A new email or Cloudflare token is used from then on. A finished install keeps its domain and region.

## Uninstall

```bash
forkrail uninstall
```

It asks you to type the domain, then deletes everything the installer made: servers, disks, addresses, apps and their data, the dashboard, buckets, tables, secrets, logs, the budget and the DNS records, in every region it used. AWS deletes the encryption keys 7 days later. The GitHub App stays on GitHub, where only you can delete it; the command prints its page.
