Make Yourself at Home with Neon Local
Neon Local is a Docker-based proxy that exposes a local Postgres endpoint for a Neon cloud database. By default it creates a fresh database branch when the container starts and deletes it when the container stops, giving isolated ephemeral environments for local development and CI without a local Postgres instance or environment drift. Configuration happens through environment variables: DRIVER selects the serverless or standard Postgres client, PARENT_BRANCH_ID picks the base branch, and DELETE_BRANCH=false keeps the branch between runs. Example docker-compose and docker run setups show how to point the Neon serverless driver at the proxy. Named branches and an offline dump/restore mode are planned.
Related posts
- Fullstack preview environments using Neon and Qovery
Neon mediumAdept
Each Qovery preview environment can get its own isolated Postgres database by using a Qovery lifecycle job that creates a copy-on-write Neon branch on the environment's Start event and deletes it on Delete. A Docker image bundles the Neon CLI and two shell scripts. create-branch.sh creates a branch named after QOVERY_ENVIRONMENT_NAME and writes direct and pooled connection strings to /qovery-output/qovery-output.json, so other services receive them as environment variables. delete-branch.sh looks up the branch ID through the Neon API and deletes it. This sidesteps the conflicts of a shared preview database and the slow provisioning, stale seed scripts and privacy issues of copying production data.
- A branch-first dev loop for Neon: link, checkout and env pull
Neon mediumAdept
Neon's CLI adds three commands for branch-first Postgres development. `neon link` binds a workspace to a project and branch via a git-ignored `.neon` file. `neon checkout` creates or switches database branches, much like `git checkout -b`. `neon env pull` writes only the Neon-managed connection strings and service secrets for the current branch into `.env`. Link and checkout run env pull automatically, which suits coding agents that need an isolated database per feature. Teams that keep secrets off disk can pass `--no-env-pull` and inject env at runtime with `@neondatabase/env` (`neon-env run`, `fetchEnv`) or export it into varlock.
- Branching Postgres databases with the Neon API
Neon mediumAdept
Neon branches are copy-on-write clones of a Postgres database that can be created and deleted through the Neon API, giving CI pipelines an isolated copy of production data for end-to-end tests. Two experimental GitHub Actions, neondatabase/create-branch-action and neondatabase/delete-branch-action, wrap the API. A sample pull-request workflow creates a branch from a parent branch, runs the test steps, then deletes the branch. The actions were beta at the time and still being hardened for production use.
- Neon Twin: Move Dev/Test/Staging to Neon, Keep Production on RDS
Neon mediumAdept
A Neon Twin is a nightly-synced copy of an RDS Postgres production database kept in Neon for dev, test and staging, so teams get instant provisioning, branching and scale-to-zero without migrating production. A scheduled GitHub Actions workflow installs Postgres, runs pg_dump in custom format against RDS, then pg_restore with --clean, --if-exists, --no-owner and --no-acl into a Neon main branch, with per-engineer branches created from it. Caveats include GitHub Actions' 6-hour job limit (use self-hosted runners for large databases), IP allowlisting problems with GitHub's changing runner IPs, and SSL certificate handling. Co-locating both databases in the same AWS region speeds up the job and cuts egress costs.
- Beyond Docker Compose: An Alternative for Deploying Postgres for Testing
Neon mediumAdept
Docker Compose with the official Postgres image gives each developer and CI run an isolated test database, but it struggles with production-like seed data, leftover state between runs, and RAM/CPU overhead. The usual workarounds each cost something: custom data images get bloated, seeding containers slow test startup, shared staging databases cause contention, and tmpfs uses a lot of RAM. Neon's alternative is copy-on-write database branches, which share storage with a parent database and get their own compute, so tests start against prepopulated data in a clean, isolated state. Local containers remain the better fit for offline work, full local control and light testing needs, while branches suit parallel CI and complex test scenarios.