Create Neon database branches for isolated preview environments

domain: neon.tech · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install the Neon CLI and authenticate: `neon auth` (follow the browser prompt).
  2. Create a branch from your main branch: `neon branches create --name preview/my-feature --parent main` — returns a branch ID and connection string.
  3. Copy the branch connection string from the output and set it as the DATABASE_URL in your preview environment (Vercel, Railway, etc.).
  4. Run migrations against the branch URL as you would against any Postgres URL; the branch is fully isolated from main.
  5. Delete the branch after the PR merges: `neon branches delete <branch-id>` to avoid accumulating idle branches.

Known gotchas

Related routes

Create Delta Lake shallow and deep clones for isolated dev/test environments without duplicating storage
docs.delta.io · 5 steps · unrated
Create a database and Postgres role in a Neon project via API and rotate a role's credentials
neon.tech · 5 steps · unrated
Restore a Neon branch to a point in time (instant restore / PITR) via API
neon.tech · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans