-
fly launch(say NO to Postgres, NO to deploy) - Create Managed Postgres via dashboard
- Enable extensions in dashboard (Extensions tab)
- Copy connection string (Connect tab)
-
fly secrets set DATABASE_URL="..." -
fly deploy
Managed Postgres (MPG) clusters are not Fly apps. They won't appear in fly apps list or fly postgres list.
| Task | MPG Command |
|---|---|
| List clusters | fly mpg list |
| Connect | fly mpg connect <cluster-id> |
| Proxy | fly mpg connect <cluster-id> --port 15432 |
| Set DB URL | fly secrets set DATABASE_URL="..." (manual) |
postgres://postgres:PASSWORD@CLUSTER.pooler.fly.io:5432/fly-db?sslmode=require
- Database name is always
fly-db(not customizable) - Use the pooler hostname from dashboard Connect tab
sslmode=requireis required
You have Managed Postgres. Use fly secrets set DATABASE_URL instead.
MPG clusters aren't apps. Use fly mpg list.
Use fly mpg connect <cluster-id> --port 15432 instead.
DATABASE_URL secret not set. Run fly secrets set DATABASE_URL="...".
Enable extensions in the Fly dashboard: Postgres → your cluster → Extensions tab.
# Terminal 1: Start proxy
fly mpg connect <cluster-id> --port 15432
# Terminal 2: Dump local and restore to Fly
pg_dump -U plc --clean --if-exists YOUR_LOCAL_DB > backup.sql
psql "postgres://postgres:PASSWORD@localhost:15432/fly-db" < backup.sqlfly launch
# Choose app name and region
# Say NO to Postgres
# Say NO to deploy now- Go to https://fly.io/dashboard
- Click Postgres → Create
- Choose name and region (same region as app)
- Note the cluster ID (e.g.,
abc123xyz)
- Go to your cluster in the dashboard
- Extensions tab: Enable any needed extensions
- Connect tab: Copy the connection string
fly secrets set DATABASE_URL="postgres://postgres:PASSWORD@CLUSTER.pooler.fly.io:5432/fly-db?sslmode=require" -a YOUR_APP
fly deploy
fly open# Check logs
fly logs
# Connect to database
fly mpg connect <cluster-id>