Skip to content

Leave Heroku without rewriting your app, with your AI (2026)

Is your Heroku bill climbing? Connected to while over MCP, your AI takes your app as it is, copies your database, and deploys it in France.

By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 19, 2026.

View as Markdown

Leave Heroku without rewriting your app, with your AI: migrate your Heroku app to while, a Heroku alternative in France, database copied and variables moved by the AI

The short version. Over MCP, your AI takes over your Heroku app, copies the database and carries over your variables. Heroku’s Node.js example ran unchanged. What matters, like deleting a database, waits for a person’s approval.

Prerequisites

  • An app on Heroku, in Node.js, Python or Go.
  • Access to your Heroku account, to export the database.
  • An AI that works in a terminal: Claude Code, Codex, Cursor or Gemini CLI.

Step 1: Give your AI this message

Open your AI in your app’s folder and paste this message into it:

The message to give your AI
Connect to while with my account (while.sh/agents), then put my app on while.

Without an account, your AI deploys your app as a trial, in one request. To keep it, open the link it gives you and create your account.

With your account, your AI adds while’s MCP server itself. If it asks you to, restart it. On the first call to while, a page opens in your browser. In Claude Code, if it doesn’t open, type /mcp, choose while, then Authenticate. On that page, choose your app, or “A new app”, then click Authorize.

Step 2: Open your app

Your AI gives you your app’s address, for example https://mon-appli.while.cloud, over HTTPS.

What your AI does

It writes while.yaml at the root of your app:

while.yaml
apiVersion: while/v1
project: mon-appli
services:
  - name: web
    port: 5006
    health:
      path: /

Heroku’s Node.js example ran on while without a single line changed2.

Migrate your Heroku app to while: the PostgreSQL database copied with pg_dump, the variables carried over, secret values typed by a person, the app at its own address before the domain switch, in France
The database, the variables and the secrets: your AI moves it all, and the app answers at its own address before the domain switch.

Copy your Heroku Postgres database

You, to your AI: Copy our Heroku database to while.

Your AI exports the database with pg_dump, then loads it into while.

Carry over your variables

You, to your AI: Carry over our Heroku config vars.

Your AI carries your settings over to while. You enter your secret keys yourself: your AI never sees them.

Replace Heroku Scheduler

You, to your AI: Bring over the Heroku Scheduler jobs.

Your AI declares them as scheduled jobs, at the same times.

Move to your own domain

You, to your AI: Put the app on www.acme.com.

Your AI declares the domain, you add the DNS records it gives you, and the HTTPS certificate follows.

Go back to the previous version

You, to your AI: Go back to the previous version.

In the 30 minutes after a production release, the previous version comes back in a second. After that, it takes a few seconds. Once the previous version is back, your AI reads what broke in while’s logs, fixes it and deploys again.

In the docs: Scheduled jobs, Custom domain, Versions and rollback and Variables and secrets.

Next steps

Sources

  1. Heroku Dev Center, runtime principles (the port given by PORT), accessed November 1, 2026
  2. Heroku on GitHub, the Node.js example with Express (node-js-getting-started), accessed November 1, 2026
  3. Heroku Dev Center, config vars, accessed November 1, 2026

Questions

What about my add-ons?

PostgreSQL databases, Redis-compatible caches, S3 storage and scheduled jobs all have their equivalent in while.

Do I need to write a Dockerfile?

No, while recognizes a Node.js, Python or Go app on its own.

Can I keep Heroku until I have checked everything?

Yes, your app runs on while at its own address before you switch your domain over.

Where do my app and its data run?

In France, at Nextmap. The database is backed up every day, with a way back over 14 days, once a person approves.

Does my AI see my credentials?

No. You paste them into while, the app uses them, and your AI never sees them. Every call is logged.

Give your AI the message, and it takes care of the rest

Give this to your AI

Read while.sh/agents and help me get started with while.

Copy the message

In 3 minutes, with no sign-up, the tool has its own address. To keep it, create your account.

For a company project, write to the while team: hello@while.sh