
- Web apps in any language (Node.js, Python, Ruby, Go, etc.)
- Postgres databases
- Redis
- Background workers
- Environment variables
- Custom domains
TL;DR - The Fast Path
For experienced developers, hereās the entire migration in 7 commands:Prerequisites
Install both CLIs:Step 1: Export Your Heroku Configuration
First, letās capture everything about your Heroku app.- Your add-ons (Postgres, Redis, etc.)
- Your dyno types (web, worker, etc.)
Step 2: Prepare Your App
Make sure you have your appās source code locally:Check for a Dockerfile
Fly works best with a Dockerfile. If you donāt have one, thatās fine -fly launch will generate one for you based on your app type.
Check your Procfile
Your HerokuProcfile maps directly to Fly processes. A typical Procfile:
Step 3: Launch on Fly
From your app directory:- Detect your app type (Node, Python, Rails, etc.)
- Generate a Dockerfile if needed
- Create a
fly.tomlconfiguration file - Ask if you want to provision a Postgres database
- Choose a name for your app (or accept the generated one)
- Select your preferred region
- Say Yes to Postgres if you need a database (choose āManaged Postgresā for the fully-managed option)
- Say No to deploy now - weāll do that after setting up secrets
Step 4: Set Up Your Database
If you have Heroku Postgres, create a Managed Postgres cluster on Fly:CLUSTER_ID part) - youāll need it for the next few commands. If you lose it, you can always find it with fly mpg list.
To import your data, use fly mpg proxy to create a local tunnel, then pg_dump and psql:
DATABASE_URL as a secret on your app.
Step 5: Set Up Redis (if needed)
If you use Heroku Redis or Redis Cloud:Step 6: Import Environment Variables
Remember thatheroku-env.txt file we created? Letās import it:
Step 7: Configure Processes (Web + Workers)
If your app has multiple process types (web + worker), edit yourfly.toml:
Step 8: Deploy
Step 9: Verify Your App
Step 10: Migrate Your Domain
If you have a custom domain on Heroku:- For apex domains (example.com): Create an A record pointing to the IPv4 address
- For subdomains (www.example.com): Create a CNAME pointing to
your-app-name.fly.dev
Quick Reference: Command Mapping
Common Add-on Replacements
Multiple Environments (Staging/Production)
Fly doesnāt have āpipelinesā like Heroku. Instead, create separate apps:Shutting Down Heroku
Once everything is working on Fly:- Update your DNS to point to Fly
- Wait for DNS propagation (check with
dig yourdomain.com) - Monitor both apps for a day to ensure no traffic goes to Heroku
- Scale down Heroku dynos:
heroku ps:scale web=0 worker=0 -a $HEROKU_APP - Cancel Heroku add-ons
- Delete the Heroku app:
heroku apps:destroy -a $HEROKU_APP