# Quickstart

> Install the CLI, set forkrail up in your AWS account, and deploy a preview and then production. It takes about 20 minutes, most of it waiting.

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

## Before you start

- **An AWS account** where you can sign in as an administrator or the root user (the root user needs MFA turned on).
- **A domain whose DNS is on Cloudflare.** The free plan is enough. Your apps get names under it, like `my-app.example.com`.
- **A GitHub account.** You and your team sign in to the dashboard with it.

You don’t need Docker, Rust or the AWS CLI. [Install forkrail](https://www.forkrail.com/docs/install) covers every requirement and option in detail.

## Install and set up

1. **Install the CLI**

   On macOS or Linux, run the install script. On Windows, use PowerShell: `irm https://forkrail.com/install.ps1 | iex`. On a Mac you can also download the app from `forkrail.com/download/mac`, which runs the same installer in a window.

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

2. **Run the installer**

   A page opens in your browser. Sign in to AWS, answer a few questions (domain, region, alert email, Cloudflare token) and click once on GitHub to create your install’s GitHub App. The installer checks the account before it changes anything, then sets everything up on its own in about 15 minutes.

```bash
forkrail install
```

3. **Open the dashboard**

   When it finishes, open `https://dashboard.<your domain>` and choose **Continue with GitHub**. Whoever created the GitHub App is the install’s first owner.

4. **Sign in the CLI**

   This links your terminal to the install. A page opens where you approve it with your GitHub sign-in. No AWS keys are needed for day-to-day work.

```bash
forkrail login https://dashboard.example.com
```

## Deploy your first app

1. **Deploy a preview**

   Run `forkrail` in your project’s folder (it’s short for `forkrail deploy`). forkrail finds the framework, uploads the source, builds it in your account and prints a preview URL. The project is named after the folder unless you pass `--project`.

```bash
cd ~/code/my-app
forkrail
# Preview: https://my-app-9f4a2d1c.example.com
```

2. **Ship it to production**

   Add `--prod`. The production URL is `https://<project>.<your domain>`, and you can add your own domain to it later.

```bash
forkrail --prod
# Production: https://my-app.example.com
```

3. **Roll back if you need to**

   Production moves back to the previous production deployment in about five seconds, without a rebuild.

```bash
forkrail rollback my-app
```

> **Prefer deploying from GitHub?:** In the dashboard choose **New project**, **Import** a repository, and click **Deploy**. From then on every push deploys: branches to previews and the production branch to production. See [Deploy from GitHub](https://www.forkrail.com/docs/deploy-from-github).

## Next steps

- [Add a custom domain](https://www.forkrail.com/docs/domains): Serve production on your own domain with an automatic certificate.
- [Set environment variables](https://www.forkrail.com/docs/environment-variables): Encrypted secrets for production, previews and local development.
- [Invite your team](https://www.forkrail.com/docs/team-and-sign-in): Add teammates by GitHub username and pick their roles.
- [Set a spend limit](https://www.forkrail.com/docs/spend-budgets): Pick a monthly budget so a runaway loop can’t run up a bill.
