# Move from Heroku

Your AI agent moves your Heroku app to Estiba: it turns the Procfile into a Dockerfile, copies the config vars and the database, and you switch the domain only once the new copy works.

## Before you start

1. [Sign up](https://app.estiba.cloud) and [connect your agent](https://estiba.cloud/docs/connect-your-agent) to Estiba, once.
2. Have the app's code on your computer (`heroku git:clone -a your-app` if you don't) and the Heroku CLI signed in, so your agent can read the config vars and the database.
3. [Add credit](https://estiba.cloud/docs/credit-and-prices), from $5. Nothing on Heroku changes until the last step.

Then ask your agent, in the app's folder: "move this Heroku app to Estiba. Keep Heroku running until I say so."

## What your agent does

- **Procfile to Dockerfile.** The `web:` line becomes the command of a `Dockerfile` at the project's root. Heroku gives the app a `PORT` variable; your agent sets the same variable on Estiba, with the port its domain uses, and checks that the app listens on `0.0.0.0`. A `worker:` line becomes a second service, with no domain, which runs all the time.
- **Config vars.** It reads them with `heroku config` and sets them on the service. Passwords, tokens and API keys go in as secrets: stored encrypted and never shown again. `DATABASE_URL` waits for the next step.
- **Postgres.** It creates a [PostgreSQL database](https://estiba.cloud/docs/postgresql-hosting) on Estiba, takes a backup on Heroku (`heroku pg:backups:capture`, then `heroku pg:backups:download`) and restores it there with `pg_restore`. Then it sets the new `DATABASE_URL` as a secret.
- **A test address.** It adds a domain of yours that nobody uses yet, such as `new.example.com`, so you can try the app on Estiba while Heroku still serves your visitors.

Your agent reads the build and the logs after each step and fixes what fails. If something does not work, see [My app doesn't work](https://estiba.cloud/docs/troubleshooting).

## Switch the domain

Once the copy on the test address works:

1. If the app takes writes (sign-ups, orders), turn on `heroku maintenance:on`, take a last backup and restore it on Estiba, so nothing written in between is lost.
2. Ask your agent to add your real domain to the service. It tells you the DNS record to create; create it where you bought the domain, in place of Heroku's. It goes live within minutes. See [Domains](https://estiba.cloud/docs/domains).
3. Keep the Heroku app for a few days, in case you need to go back. Then remove it, and its add-ons, so they stop costing.

## What changes

- **No dyno sizes.** You pay for the memory and CPU the app really uses, measured every second: $4 per GB of memory and $8 per vCPU busy, a month, and $0.10 per GB kept in a volume, taxes included.
- **Sleeping is up to you.** A website with no visits for 5 minutes sleeps and costs nothing but its volume; the next visit wakes it. If it must answer at once, ask your agent to keep it always on.
- **Scheduled jobs.** Estiba has no Heroku Scheduler. An app that runs its own scheduled jobs is kept always on.
- **Prepaid.** No bill arrives: when the credit runs out, the apps stop until you add more.

## What it costs

On Heroku's [pricing page](https://www.heroku.com/pricing), on 23 November 2026, a Basic dyno, always on with 0.5 GB, is $7 a month; Eco, $5, sleeps after 30 minutes without visits. The cheapest Heroku Postgres, Essential-0, is $5 a month.

On Estiba, an app that holds 512 MB and keeps 2 % of a vCPU busy, always on, comes to 0.5 × $4 + 0.02 × $8 = **$2.16 a month**, plus its volume (a 256 MB image: $0.03). Most small apps hold less: one with 128 MB comes to about $0.69. A PostgreSQL started empty on one of Estiba's servers costs about $0.16 a month and grows with your data. The dashboard shows what yours really uses.

Where Heroku is better: a fixed price is easier to predict, and Heroku Postgres takes its own backups. An app that holds over about 1 GB all month can come out cheaper on a server rented at a fixed price.
