

# Develop locally

You can run your Amplify backend on your computer while you build your app. The local backend runs a PostgreSQL database, auth and a data API in Docker or Finch. When your app works, run `aws amplifygen3 deploy` from the AWS Amplify CLI to deploy it to AWS, where other people can use it.

## Why develop locally
<a name="_why_develop_locally"></a>

Developing on your computer has the following advantages:
+  **Works without an AWS account** – The local commands need no AWS account or AWS credentials, and they create no resources in AWS.
+  **Nothing to pay while you build** – The local backend runs on your computer, so it adds no charges to your AWS bill.
+  **A change loop on your computer** – You apply a migration, try it in your app and reset your data as often as you need, with no deployment in between. An AI coding agent can run the same loop on its own, many times in a row.
+  **Data that stays on your computer** – Your local data and local users are separate from every environment, such as `preview` and `production`.
+  **Offline work** – After the first download, the local backend starts without a network connection for up to 7 days.
+  **The same migrations and auth settings** – The local backend applies the same migrations and auth settings as a deployment.

## Quickstart
<a name="_quickstart"></a>

Follow these steps to start a local backend for your app:

1. Start Docker or Finch.

1. In your app’s folder, run the following command to add a backend:

   ```bash
   aws amplifygen3 local init --type fullstack
   ```

   If your app already has an `amplify.jsonc` file, run `aws amplifygen3 local backend add` instead.

1. Install your app’s dependencies, such as with `npm install`.

1. Run the following command to start the local backend and your app’s dev server:

   ```bash
   aws amplifygen3 local run
   ```

   You should see the backend URL, your app’s address, and the addresses of the local console and Mailpit.

1. When you’re done, run `aws amplifygen3 local stop`. Your local data stays for the next run.

## Work locally
<a name="_work_locally"></a>

Use the following pages to work with the local backend:
+  ** [Local development workflow](backend-local-workflow.md) ** – Start a new app or work on an existing one, make a change, and deploy it to `preview`.
+  ** [Local database](backend-local-database.md) ** – Apply migrations, run SQL, load seed data, reset the local database and test your row-level security (RLS) policies.
+  ** [Local console](backend-local-console.md) ** – Browse your tables, run SQL, create test users and read logs in your browser.
+  ** [Local auth and emails](backend-local-auth.md) ** – Sign in as local users, call the data API with the local publishable key, and read auth emails in Mailpit.
+  ** [Docker and Finch](backend-local-runtimes.md) ** – Choose the container runtime, and pick the PostgreSQL client that the `db` commands use.