> ## 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.

# Replit → AWS

> Move off Replit's always-on tier to a real EC2 instance without sleep penalties.

Replit's Always On feature keeps your app running but comes with limitations on compute, cold starts, and cost. This guide migrates your Replit app to a dedicated EC2 instance with true always-on uptime.

## What gets migrated

* Any language or framework (Node.js, Python, Go, Ruby, etc.)
* `replit.nix` environment definition (converted to Dockerfile)
* Replit Secrets → Nometria environment variables
* Static files

## Prerequisites

* An Nometria account
* Your Replit project connected to GitHub (recommended) or a ZIP export

## Step 1 — Export from Replit

<Tabs>
  <Tab title="Via GitHub (recommended)">
    1. In Replit, click **Version Control** (Git icon in the sidebar)
    2. Connect your Replit project to a GitHub repository
    3. Push the current state
    4. In Nometria, select **Connect via GitHub** and choose that repo
  </Tab>

  <Tab title="Via ZIP">
    1. In Replit, click the three dots (⋯) next to your project name → **Download as zip**
    2. Upload the ZIP to Nometria via **New Migration** → **Upload ZIP**
  </Tab>
</Tabs>

## Step 2 — Configure

<Steps>
  <Step title="Environment (Nix → Docker)">
    Replit uses `replit.nix` to define the environment. Nometria reads this file and converts it to a Dockerfile automatically.

    If your project already has a `Dockerfile`, Nometria uses it directly.

    For most Node.js and Python apps, the conversion is automatic. For unusual Nix packages, you'll see a warning and can provide a manual Dockerfile override.
  </Step>

  <Step title="Migrate Replit Secrets">
    Replit Secrets don't export with your project. Re-enter them in Nometria's environment variable screen:

    ```bash theme={null}
    # Common Replit secrets
    DATABASE_URL=postgresql://...
    SECRET_KEY=...
    OPENAI_API_KEY=sk-...
    ```

    <Tip>In Replit, open your project → Secrets (lock icon) to see all your secret names. You'll need to copy the values from wherever you originally stored them.</Tip>
  </Step>

  <Step title="Start command">
    Nometria detects the start command from:

    * `.replit` file (`run` field)
    * `package.json` `start` script
    * `main.py` (for Python apps)

    Verify the detected start command on the configuration screen and override if needed.
  </Step>

  <Step title="Port">
    Replit apps typically listen on port 8080 or 3000. Nometria proxies the correct port automatically — but confirm the detected port on the configuration screen.
  </Step>
</Steps>

## Step 3 — Database migration

**If you use Replit DB:** Replit DB is a key-value store proprietary to Replit. You'll need to migrate to Supabase (PostgreSQL) or another database. This requires updating your app code.

**If you use PostgreSQL via Replit:** Export your database:

```bash theme={null}
pg_dump $DATABASE_URL > backup.sql
```

Then in Nometria, create a new Supabase project and use the seed file option to import your dump.

**If you use an external database (PlanetScale, Neon, etc.):** No migration needed — update your `DATABASE_URL` environment variable to point to your external database.

## Step 4 — Deploy

Click **Deploy**. Nometria builds from your Dockerfile (or generates one) and deploys to EC2.

## Why EC2 vs Replit Always On

|               | Replit Always On             | Nometria EC2      |
| ------------- | ---------------------------- | ----------------- |
| Uptime        | 99% (sleep between requests) | 99.9%+ (no sleep) |
| Cold starts   | Yes                          | No                |
| Compute       | Shared, throttled            | Dedicated vCPU    |
| Custom domain | Paid add-on                  | Included          |
| SSH access    | No                           | Yes               |
| Cost          | Usage-based                  | Fixed monthly     |

## Post-migration checklist

* [ ] App starts and responds at your live URL
* [ ] All Replit secrets re-entered as Nometria env vars
* [ ] Database migrated and accessible
* [ ] No references to `process.env.REPL_*` (Replit-specific env vars) in your code
* [ ] Always On disabled on Replit to avoid double billing
