How to Create a Free Serverless Postgres Database With Neon
Neon is a serverless Postgres service that separates storage from compute. Databases scale to zero when idle and wake in milliseconds, and every project supports instant branching — a copy of your database you can test migrations against.
What Is Neon, and Why Use It Over Standard Postgres?
Neon runs real Postgres, not a compatible substitute. What changes is the architecture: compute scales down automatically and storage is shared across branches. That makes it a fit for CI pipelines, preview environments, and apps with unpredictable traffic.
How to Create Your First Neon Database
- Sign up at neon.tech and create a project; choose a region near your app.
- Pick a Postgres version (16 or 17 are current) and name your first database.
- Copy the connection string from the dashboard — it includes the pooled endpoint.
- Connect with
psql "your_connection_string"or paste it into your app’s env vars. - Run
CREATE TABLEas usual; there’s no proprietary SQL.
Setup takes about five minutes. The pooled connection endpoint matters for serverless apps, since each request may open a new connection.
How Does Branching Work?
A branch is a copy-on-write clone of your data. Schema changes on a branch don’t touch main, and branches start instantly regardless of database size. Use one branch per pull request, run your migrations there, and point preview deploys at it. Deleting the branch cleans up everything.
Is Neon Free?
Yes, the Free plan includes storage on a shared compute tier with a monthly compute-hour allowance. It is enough for hobby projects and small production apps, but compute hours run out if you keep a heavy database always busy. Paid plans start around $19/month and remove the scale-to-zero pause.
| Plan | Compute | Best for |
|---|---|---|
| Free | Shared, scale-to-zero | Hobby, small apps |
| Launch | Dedicated (~$19/mo) | Always-on production |
What Are the Gotchas?
Cold starts add latency to the first query after idle — often fine, occasionally not. Connection limits on the free tier are tighter than a self-hosted box, so use the pooled endpoint. Cross-region reads cost more latency; pick the region closest to your backend.
Quick Summary
- Neon is serverless Postgres with scale-to-zero and instant branching.
- Create a project, grab the connection string, and use standard SQL.
- Branches are copy-on-write clones, ideal for per-PR test databases.
- Free tier suits small apps; Launch (~$19/mo) removes idle pause.
- Watch cold starts and connection limits on the free plan.
