> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fjall.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Install the Fjall CLI, connect your AWS account, and deploy your first application to AWS.

## Prerequisites

You need:

* **AWS account**: [Create one here](https://aws.amazon.com/free/) if you do not have one
* **Node.js 22+**: [Download](https://nodejs.org/)
* **npm**: included with Node.js
* **Fjall account**: [Sign up](https://fjall.io) to get your API key

## Quick Start

### 1. Install the CLI

```bash theme={null}
npm install -g fjall
```

Verify the installation:

```bash theme={null}
fjall --version
```

### 2. Log in to Fjall

```bash theme={null}
fjall login
```

Interactive `fjall login` opens your browser to authenticate via the device-code flow. To enter an API key instead, press `e` at the prompt. For non-interactive environments (CI/CD), use `fjall login --api-key <key>` with an API key from your [Fjall account dashboard](https://fjall.io). The CLI stores credentials at `~/.fjall/auth.json`.

### 3. Connect your AWS account

Connect Fjall to your AWS account via OIDC. This deploys a small CloudFormation stack that grants Fjall permission to manage resources.

```bash theme={null}
fjall connect
```

The CLI first prompts for your primary AWS region and environment (it skips a prompt when the value is already known). It then auto-opens your browser to a CloudFormation Quick Create page and prints the URL as a fallback. Review the stack, click **Create stack**, and the CLI detects the connection automatically.

### 4. Create account infrastructure

Deploy monitoring, compliance, and container registry infrastructure to your AWS account:

```bash theme={null}
fjall create account
```

Then deploy it:

```bash theme={null}
fjall deploy account
```

This provisions the base infrastructure in your AWS account. It only needs to run once.

### 5. Create your first application

Create a standard web application:

```bash theme={null}
mkdir my-app && cd my-app
fjall create app --name myapp
```

`--name` pre-fills the application name. The interactive creator then prompts for the configuration tier and database before scaffolding the `fjall/myapp/` directory. Pass `--type <tier>` to skip the prompts.

### 6. Deploy

```bash theme={null}
fjall deploy myapp
```

First deployment takes 10 to 15 minutes while AWS provisions all resources. Subsequent deployments are faster.

After deployment completes, the CLI prints your application URL:

```
Outputs:
  CloudFrontURL: https://d1234567890.cloudfront.net
```

<Note>
  For multi-account setups, use `fjall create organisation` instead of steps 3 and 4. This creates a full AWS Organisation with platform, account, and member account infrastructure. See the [Organisation Guide](/deployment/deploy-organisation) for details.
</Note>

## Choose a tier

Each tier configures compute, networking, and database resources for a specific use case. The interactive picker lists six options: Standard, Lightweight, Resilient, Enterprise, Tinkerer, and Custom. Standard is the recommended starting point.

| Tier                                         | Summary                                                                            | Monthly cost |
| -------------------------------------------- | ---------------------------------------------------------------------------------- | ------------ |
| [Standard](/patterns/standard-pattern)       | 3 AZ, 1 NAT, Fargate, RDS Instance (t4g.large), production-ready                   | \~\$50-100   |
| [Tinkerer](/patterns/tinkerer-pattern)       | 2 AZ, no NAT, ECS on EC2 (t4g.micro), RDS Instance (t4g.micro), free-tier eligible | \~\$5-15     |
| [Lightweight](/patterns/lightweight-pattern) | 2 AZ, 1 NAT, Fargate Spot, RDS Instance (t4g.small), cost-effective                | \~\$25-50    |
| [Resilient](/patterns/resilient-pattern)     | 3 AZ, 3 NAT, Aurora with readers, KMS encryption, RDS Proxy, 30-day backup         | \~\$150-300  |
| [Enterprise](/patterns/enterprise-pattern)   | 3 AZ, 3 NAT, Aurora with readers, KMS, VPC endpoints, maximum compliance           | \~\$300+     |
| [Custom](/patterns/starter-pattern)          | Full control over all configuration                                                | Varies       |

Create an application with a specific tier:

```bash theme={null}
fjall create app --name myapp --type tinkerer
```

### Patterns

Patterns scaffold a framework-specific application via a separate interactive flow. The pattern picker offers Payload CMS and Next.js (OpenNext), each with four configuration tiers: Standard, Lightweight, Resilient, and Custom.

`payload` is the only pattern you can deploy today. Create one with the long-form flag (there is no `-p` short flag):

```bash theme={null}
fjall create app --name myapp --pattern payload
```

<Warning>
  The `nextjs` pattern is not yet deployable. Recent CLI versions no longer offer it and refuse `--pattern nextjs` at create time; older versions accepted it and failed at deploy. Use `--pattern payload` for a Next.js-based app, or [`--pattern staticsite`](/patterns/static-site-pattern) for a pre-built static site.
</Warning>

## What happens during deployment

When you run `fjall deploy`, the CLI:

1. **Synthesises** CloudFormation templates from your infrastructure code
2. **Bootstraps** the CDK toolkit stack (first time only)
3. **Builds** your application and creates Docker images
4. **Deploys** AWS resources via CloudFormation
5. **Outputs** endpoints and resource information

## Troubleshooting

### Command Not Found

```bash theme={null}
fjall: command not found
```

**Solution**: Check that the npm global bin directory is in your PATH:

```bash theme={null}
export PATH="$PATH:$(npm config get prefix)/bin"
```

### AWS Credentials Error

```bash theme={null}
Error: Unable to resolve AWS account
```

**Solution**: Check that your AWS account is connected:

```bash theme={null}
fjall connect
```

This will verify your existing connection or start a new one. If your credentials have expired, the CLI will automatically prompt you to re-authenticate when you next run a deployment command.

### Deployment Timeout

First deployments can take 15+ minutes. If deployment times out, check the CloudFormation console for status, then retry:

```bash theme={null}
fjall deploy myapp
```

### Need Help?

* Check the [CLI Reference](/cli/create) for command details
* Join the [Discord community](https://discord.gg/FqAdh6SA2m)
* Email [support@fjall.io](mailto:support@fjall.io)

## Next Steps

<CardGroup cols={2}>
  <Card title="Add Resources" icon="plus" href="/deployment/add-resources">
    Extend your application with databases, storage, and more
  </Card>

  <Card title="CLI Reference" icon="terminal" href="/cli/create">
    Explore all available commands
  </Card>

  <Card title="Patterns" icon="layer-group" href="/patterns/standard-pattern">
    Learn about architecture patterns
  </Card>

  <Card title="Understand Profiles" icon="gear" href="/deployment/understanding-profiles">
    Learn about deployment profiles and regions
  </Card>
</CardGroup>
