Skip to content

Use Managed Postgres in the Phoenix getting started guide - #2672

Open
alexleventer wants to merge 2 commits into
mainfrom
phoenix-mpg
Open

alexleventer wants to merge 2 commits into
mainfrom
phoenix-mpg

Conversation

@alexleventer

@alexleventer alexleventer commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claude (Claude Code) wrote this change from an agent-readiness review.

Summary of changes

Deploy a Phoenix App told readers to select Fly Postgres in the launch UI and showed an unmanaged postgres-flex cluster being created. Agents reading this guide create an unmanaged cluster instead of Managed Postgres.

  • Run fly launch --db=mpg. In flyctl v0.5.14 (internal/command/launch/plan/postgres.go), --db=mpg plans a Managed Postgres cluster on the Basic plan, offers to switch region if the current one has no MPG, then launch_databases.go waits for it and sets DATABASE_URL.
  • Replace the old summary and the long postgres-flex output with a short description, keeping only the last line (Visit your newly deployed app at ..., from internal/command/deploy/deploy.go).
  • Add one line, right under the command, for Free plan orgs: launch creates a Basic cluster, which ui-ex refuses for Free orgs (Fly.Billing.FreePlan.check_managed_postgres/4), so they run fly launch --no-db --no-deploy, create a Developer cluster with fly mpg create, fly mpg attach it, then fly deploy. Without --no-deploy, launch carries on after the failed create and deploys with no DATABASE_URL.
  • Swap fly status -a <db app> for fly mpg status, drop the "note your Postgres credentials" note, and fix the recap sentence.

Preview

https://docs.fly.io/elixir/getting-started/ (after merge)

Related Fly.io community and GitHub links

Notes

  • I didn't run a real launch, so there is no new sample output. The old output was trimmed rather than rewritten.
  • Plain fly launch (no --db) picks Managed Postgres only when a LaunchDarkly flag is on and the session is interactive; otherwise it falls back to unmanaged with a deprecation warning. The web launch page's Postgres options are also flag-gated (launch-postgres-choice). I couldn't see either flag's value, so the guide uses --db=mpg, which doesn't depend on them.
  • postgres/guides-examples/phoenix-guide.mdx already covers Managed Postgres (PgBouncer mode, migrations, Oban) and has no launch walkthrough, so it's unchanged.
  • This guide now provisions a paid Basic cluster ($38/month) for Pay As You Go readers.
  • In flyctl v0.5.14, dev-256 is hidden from the plan prompt and the API offers it only to orgs with its flag (internal/command/mpg/plans.go), so whether a Free reader sees the Developer plan in fly mpg create depends on that flag. I didn't run the Free path.

The guide told readers to pick Fly Postgres and showed an unmanaged
postgres-flex cluster being created. It now runs fly launch --db=mpg
and trims the sample output.
@alexleventer
alexleventer requested a review from a team as a code owner November 22, 2026 19:42
@mintlify

mintlify Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
fly-io 🟢 Ready View Preview Nov 22, 2026, 7:47 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

This branch was successfully deployed

1 active deployment
staging — 417cd608 Deployed Nov 22, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant