Skip to content
Home / Migrations / Heroku → Railway

Heroku → Railway

easy

Railway is the closest Heroku experience. Procfile compatible, auto-detect buildpacks, built-in Postgres.

Estimated: 1-3h · 5 steps
Progress0%
Step 1: Create Railway project

Sign up at railway.app, create new project from GitHub repo.

railway login && railway init
Step 2: Add database

Click 'New' → PostgreSQL in Railway dashboard. Connection string auto-injected as DATABASE_URL.

Step 3: Set environment variables

Copy env vars from Heroku. Railway: Settings → Variables.

heroku config -s | railway variables set
Step 4: Migrate database

pg_dump from Heroku, pg_restore to Railway.

heroku pg:backups:download && pg_restore -d $RAILWAY_DATABASE_URL latest.dump
Step 5: Update DNS

Add custom domain in Railway settings. Update DNS CNAME.

✓ Site loads on custom domain
Get started with Railway →

What this migration involves

Moving from Heroku to Railway is rated easy and takes about 1-3h on a typical project. The guide breaks it into 5 steps, 3 of which ship with runnable commands and 1 with a verification check.

FAQ

How long does migrating from Heroku to Railway take?

Around 1-3h for a typical project — 5 steps, difficulty rated easy, 3 of them with copy-paste commands.

Is moving from Heroku to Railway reversible?

No reverse guide is tracked yet, so treat this as a one-way move and keep a full export of your Heroku data before you start.

What does Railway cost compared to Heroku?

Railway: freemium from $5/mo, free plan available.