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

# How Deployment Works

> What Nometria provisions on your behalf when you deploy an app.

When you click **Deploy**, Nometria provisions a complete production stack on AWS — no AWS console required.

## What gets created

<Steps>
  <Step title="EC2 instance">
    An Amazon EC2 instance is launched in your chosen region. Nometria selects an appropriate instance type based on your app's detected stack (a lightweight React app gets a different instance than a full-stack Python + Node app).

    The instance runs your app inside a Docker container for process isolation and clean restarts.
  </Step>

  <Step title="DNS records via Route53">
    Nometria creates the DNS records for your custom domain using Amazon Route53. An A record or CNAME is created pointing to your EC2 instance's IP.

    If you haven't added your domain yet, a free `*.nometria.com` staging URL is provisioned immediately.
  </Step>

  <Step title="SSL certificate">
    TLS certificates are issued automatically via AWS Certificate Manager (ACM). HTTPS is enforced by default — HTTP requests are redirected to HTTPS.
  </Step>

  <Step title="App build and start">
    Your code is built inside the container:

    * **Node/React**: `npm install && npm run build`, then `npm run start` (or served by nginx for static apps)
    * **Python**: `pip install -r requirements.txt && uvicorn main:app` (or gunicorn)
    * **Docker**: `docker build && docker run`

    Build logs are streamed to your dashboard in real time.
  </Step>

  <Step title="Health check">
    Nometria polls your app's root URL until it returns a 200. Once healthy, your domain goes live and deployment is marked complete.
  </Step>
</Steps>

## Deployment timeline

| Phase                    | Typical time                                |
| ------------------------ | ------------------------------------------- |
| Instance provisioning    | 60–90 seconds                               |
| DNS propagation          | 1–5 minutes (up to 48h for some registrars) |
| App build                | 1–4 minutes depending on dependencies       |
| SSL issuance             | 1–3 minutes                                 |
| **Total (first deploy)** | **\~5–10 minutes**                          |

Subsequent deploys skip provisioning and are typically **under 2 minutes**.

## Redeployments

Every push to your connected GitHub branch triggers an automatic redeploy:

1. Nometria pulls the latest commit
2. Rebuilds the Docker image
3. Does a zero-downtime swap — the old container stays live until the new one is healthy
4. Updates the deployment log with the commit SHA and timestamp

You can also trigger a manual redeploy from the dashboard at any time.

## Rollbacks

Every successful deployment is tagged with its Git commit SHA. To roll back:

1. Dashboard → your project → **Deployments**
2. Find the previous successful deployment
3. Click **Redeploy this version**

Nometria redeploys that exact commit — same code, same environment variables as of that deploy.

## Regions

Available AWS regions:

* `us-east-1` — US East (N. Virginia)
* `us-west-2` — US West (Oregon)
* `eu-west-1` — Europe (Ireland)
* `ap-southeast-1` — Asia Pacific (Singapore)

<Tip>Choose the region closest to your primary users for lowest latency. If you're not sure, `us-east-1` is a good default.</Tip>

## Next steps

<Columns cols={2}>
  <Card title="Custom domains & DNS" icon="globe" href="/deploy/domains">
    Point your own domain to your deployment
  </Card>

  <Card title="Environment variables" icon="key" href="/deploy/environment">
    Add secrets and per-environment config
  </Card>

  <Card title="Database setup" icon="database" href="/deploy/database">
    Connect Supabase or Appwrite
  </Card>

  <Card title="Two-way sync" icon="arrows-rotate" href="/sync/overview">
    Keep your builder and production in sync
  </Card>
</Columns>
