---
title: "Railway vs while: the French alternative for your AI agent"
url: https://while.sh/en/comparisons/while-vs-railway/
author: "Grégoire Mougeolle, co-founder of Nextmap"
updated: 2026-11-02
---

# Railway vs while: which one to choose when your AI agent deploys?

Railway is one of the most pleasant hosts for an AI agent. while goes further on production: what could break it waits for your approval, your agent never sees your keys, and your data stays in France.

## What changes between Railway and while

| What matters | Railway | while |
|---|---|---|
| Who it's for | Developers who want to deploy fast, with or without an agent | People who build their apps with an AI agent, solo or as a team |
| Your AI agent | An MCP server, with OAuth, on the projects you choose (source 1) | Connected over MCP, with OAuth: it deploys, creates the database, reads the logs and fixes things |
| What protects production | A confirmation your AI tool asks for, if it honors the flag on destructive actions (source 1) | Sensitive actions, like deleting a production database, wait for a person |
| Your API keys | Your agent can retrieve your variables (source 1) | Your agent never sees them: they stay in while |
| The database | PostgreSQL in a single request, from a template (source 1) | PostgreSQL in while, backed up every day, with point-in-time recovery |
| In France | No, Amsterdam is the closest (source 2) | Yes, with Nextmap, a French company |
| To get started | Hobby at $5 per month, with up to $5 of usage included (source 3) | A trial without an account. Then €0 to get started, and €13.75 per month for an app and its database |

## Railway, one of the smoothest hosts for an agent

With OAuth, you choose which projects your agent sees, and it creates a PostgreSQL database in a single request (source 1). Railway bills by usage, and it stops your services at the spending limit you set (sources 3 and 4).

## With while, your AI agent does the rest

- **Your agent deploys, over MCP.** It writes while.yaml, creates the database, reads the logs and fixes things, with no command line to learn.
- **Nothing serious happens without you.** Deleting a production database waits for your approval, before it runs, and every action is recorded in a signed activity log.
- **Your keys stay secret.** Your app uses them, your agent never sees them.
- **Your colleagues sign in with the company account.** Google Workspace or Microsoft 365, on the Pro plan, with no sign-in page to code.
- **A mistake is quickly undone.** In the 30 minutes after a deployment, the previous version comes back in a second, and your database goes back to a precise moment.

## Moving from Railway to while

### Take over your app

> You, to your agent: Move our Railway app to while.

Your agent writes while.yaml from your code. A Node.js, Python or Go app starts without a Dockerfile, the others with yours.

### Copy your PostgreSQL database

> You, to your agent: Copy our PostgreSQL database to while.

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

### Carry over your variables

> You, to your agent: Carry over our environment variables.

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

## Which one to choose

- **Choose Railway** if your apps must stop dead at a spending limit, production included, and France doesn't matter.
- **Choose while** if your AI agent deploys your apps, and you want to stay in control without reviewing every command, with your data in France.

## Next steps

- [Deploy a Node.js API and its PostgreSQL database](/en/guides/deploy-node-api-postgresql/)

## Sources

1. [Railway, the MCP server](https://docs.railway.com/ai/mcp-server), 2026-11-02
2. [Railway, regions](https://docs.railway.com/deployments/regions), 2026-11-02
3. [Railway, plans](https://docs.railway.com/pricing/plans), 2026-11-02
4. [Railway, the spending cap](https://docs.railway.com/pricing/cost-control), 2026-11-02

## Questions

### Does Railway have a region in France?

No, its European region is in Amsterdam (source 2). while hosts in France.

### Does my agent see my variables?

On Railway, it can retrieve them, even into a .env file (source 1). On while, it never sees your keys.

### Which one has a spending cap?

Railway stops your services at the limit you set (source 4). On while, each project has its budget: a change that would exceed it waits for your approval, an alert goes out at 80% and at 100%, and a live app is never cut off.
