BuildWithMatija
  1. Home
  2. Blog
  3. Tools
  4. Neon Postgres: Free Claimable DB in Minutes — No Install

Neon Postgres: Free Claimable DB in Minutes — No Install

Create a free Neon Postgres (Postgres 17) in one curl command; get a pooled DATABASE_URL and an optional direct URL…

11th May 2026·Updated on:11th May 2026··
Tools
Neon Postgres: Free Claimable DB in Minutes — No Install

📚 Get Practical Development Guides

Join developers getting comprehensive guides, code examples, optimization tips, and time-saving prompts to accelerate their development workflow.

No spam. Unsubscribe anytime.

📄View markdown version
0

Frequently Asked Questions

About the author

Matija Žiberna

Matija Žiberna

Full-stack developer, co-founder

AboutResume

Self-taught full-stack developer sharing lessons from building software and startups.

I'm Matija Žiberna, a self-taught full-stack developer and co-founder passionate about building products, writing clean code, and figuring out how to turn ideas into businesses. I write about web development with Next.js, lessons from entrepreneurship, and the journey of learning by doing. My goal is to provide value through code—whether it's through tools, content, or real-world software.

Contents

  • What You Are Creating
  • When This Is Useful
  • Before You Start
  • Step 1: Create the Database
  • Step 2: Look at the Response
  • Step 3: Copy `connection_string` into Your `.env` File
  • Step 4: Restart Your App
  • The Most Important Detail: Pooled vs Direct URL
  • What the pooled hostname looks like
  • If You Need a Direct URL for Migrations
  • Example
  • Example full env setup
  • The Easiest Setup Pattern
  • CLI Option: Let Neon Write the `.env` File for You
  • How to Claim the Database So It Does Not Expire
  • Limits of the Free Unclaimed Database
  • Common Questions
  • Do I need a Neon account to create the database?
  • Do I need to install Postgres locally?
  • Is this a real Postgres database?
  • Should I use the pooled URL or the direct URL?
  • What happens if I do nothing?
  • Can I keep the same database?
  • Copy-Paste Checklist
  • One-Sentence Version
  • Official Links
On this page:
  • What You Are Creating
  • When This Is Useful
  • Before You Start
  • Step 1: Create the Database
  • Step 2: Look at the Response
Build with Matija logo

Build with Matija

Modern websites, content systems, and AI workflows built for long-term growth.

Services

  • Headless CMS Websites
  • Next.js & Headless CMS Advisory
  • AI Systems & Automation
  • Website & Content Audit

Resources

  • Case Studies
  • How I Work
  • Blog
  • CMS Hub
  • E-commerce Hub
  • Dashboard

Headless CMS

  • Payload CMS Developer
  • CMS Migration
  • Multi-Tenant CMS
  • Payload vs Sanity
  • Payload vs WordPress
  • Payload vs Contentful

Get in Touch

Ready to modernize your stack? Let's talk about what you're building.

Book a discovery callContact me →
© 2026Build with Matija•All rights reserved•Privacy Policy•Terms of Service
BuildWithMatija
Get In Touch

If you want a real Postgres database without installing anything locally, Neon gives you a very fast option:

  • it is free to start
  • it takes one command
  • you do not need a Neon account to create it
  • you get a working database URL immediately

This guide is written to be extremely easy to follow, even if you have never created a cloud database before.

What You Are Creating

You are creating a temporary Neon Postgres database through neon.new.

This is called a claimable database because:

  • it works immediately after creation
  • it is free
  • it expires after 72 hours if you do nothing
  • you can later "claim" it into your Neon account if you want to keep it

Neon says these databases are currently provisioned on:

  • AWS us-east-2
  • Postgres 17

When This Is Useful

This is a very good fit for:

  • local development
  • side projects
  • hackathons
  • prototypes
  • demos
  • temporary test environments

It is not meant to be your long-term production database unless you claim it and move into a normal Neon setup.

Before You Start

You only need:

  • a terminal
  • curl
  • a place to paste your database URL, usually a .env file

If your app uses PostgreSQL, it likely expects a variable called:

env
DATABASE_URL=

Step 1: Create the Database

Run this command:

bash
curl -X POST https://neon.new/api/v1/database \
  -H 'Content-Type: application/json' \
  -d '{"ref":"your-app-name"}'

Replace your-app-name with something simple that identifies your project.

Examples:

bash
curl -X POST https://neon.new/api/v1/database \
  -H 'Content-Type: application/json' \
  -d '{"ref":"my-nextjs-app"}'
bash
curl -X POST https://neon.new/api/v1/database \
  -H 'Content-Type: application/json' \
  -d '{"ref":"portfolio-site"}'

Step 2: Look at the Response

Neon will return JSON that looks like this:

json
{
  "id": "01abc123-def4-5678-9abc-def012345678",
  "status": "UNCLAIMED",
  "neon_project_id": "cool-breeze-12345678",
  "connection_string": "postgresql://neondb_owner:npg_xxxx@ep-cool-breeze-pooler.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require",
  "claim_url": "https://neon.new/claim/01abc123-def4-5678-9abc-def012345678",
  "expires_at": "2026-02-01T12:00:00.000Z",
  "created_at": "2026-01-29T12:00:00.000Z",
  "updated_at": "2026-01-29T12:00:00.000Z"
}

You do not need to understand every field.

The 3 fields that matter most are:

  • connection_string
  • claim_url
  • expires_at

Here is what each one means:

  • connection_string This is the main database URL you will paste into your app.
  • claim_url Open this link later if you want to keep the database longer than 72 hours.
  • expires_at This is the exact expiration time for the temporary database.

Step 3: Copy connection_string into Your .env File

In most apps, you should paste the returned connection_string into:

env
DATABASE_URL=postgresql://...

Example:

env
DATABASE_URL=postgresql://neondb_owner:npg_xxxxxxxxxxxx@ep-example-pooler.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require

If your project already has a .env file, open it and replace the old DATABASE_URL.

If your project does not have one yet, create a .env file and add:

env
DATABASE_URL=postgresql://neondb_owner:npg_xxxxxxxxxxxx@ep-example-pooler.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require

Step 4: Restart Your App

If your development server is already running, stop it and start it again.

Why:

  • many frameworks only read .env values at startup
  • if you do not restart, your app may still use the old database URL

The Most Important Detail: Pooled vs Direct URL

The connection_string Neon returns is a pooled URL.

That is usually the correct one for:

  • application queries
  • local app development
  • server runtimes
  • most normal usage

You should generally use this for:

env
DATABASE_URL=...

What the pooled hostname looks like

A pooled Neon hostname contains:

txt
-pooler

Example:

txt
ep-example-pooler.c-2.us-east-2.aws.neon.tech

If You Need a Direct URL for Migrations

Some tools prefer a direct database connection for migrations.

To create a direct URL:

  1. take the same connection_string
  2. find the hostname
  3. remove -pooler

Example

Pooled hostname:

txt
ep-example-pooler.c-2.us-east-2.aws.neon.tech

Direct hostname:

txt
ep-example.c-2.us-east-2.aws.neon.tech

Example full env setup

env
DATABASE_URL=postgresql://neondb_owner:npg_xxxxxxxxxxxx@ep-example-pooler.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require
DATABASE_URL_DIRECT=postgresql://neondb_owner:npg_xxxxxxxxxxxx@ep-example.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require
PUBLIC_POSTGRES_CLAIM_URL=https://neon.new/claim/01abc123-def4-5678-9abc-def012345678

Use this as a simple rule:

  • DATABASE_URL = pooled URL for the app
  • DATABASE_URL_DIRECT = direct URL for migrations if your tooling wants it

The Easiest Setup Pattern

If you want the safest and simplest setup, use this template:

env
DATABASE_URL=postgresql://neondb_owner:npg_xxxxxxxxxxxx@ep-example-pooler.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require
DATABASE_URL_DIRECT=postgresql://neondb_owner:npg_xxxxxxxxxxxx@ep-example.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require
PUBLIC_POSTGRES_CLAIM_URL=https://neon.new/claim/01abc123-def4-5678-9abc-def012345678

If your app also requires a secret, keep that in the same file too.

Example:

env
DATABASE_URL=postgresql://neondb_owner:npg_xxxxxxxxxxxx@ep-example-pooler.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require
DATABASE_URL_DIRECT=postgresql://neondb_owner:npg_xxxxxxxxxxxx@ep-example.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require
PAYLOAD_SECRET=your-existing-secret
PUBLIC_POSTGRES_CLAIM_URL=https://neon.new/claim/01abc123-def4-5678-9abc-def012345678

CLI Option: Let Neon Write the .env File for You

If you want Neon to handle the env file for you, use the CLI:

bash
npx neon-new --yes

According to the Neon docs, this writes values like these into .env:

env
DATABASE_URL=postgresql://neondb_owner:npg_xxxxxxxxxxxx@ep-cool-breeze-a1b2c3d4-pooler.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require
DATABASE_URL_DIRECT=postgresql://neondb_owner:npg_xxxxxxxxxxxx@ep-cool-breeze-a1b2c3d4.c-2.us-east-2.aws.neon.tech/neondb?channel_binding=require&sslmode=require
# Claimable DB expires at: Sat, 01 Feb 2026 12:00:00 GMT
# Claim it now to your account using the link below:
PUBLIC_POSTGRES_CLAIM_URL=https://neon.new/claim/01abc123-def4-5678-9abc-def012345678

This is the easiest option if:

  • you are starting a brand-new project
  • you want a quick setup
  • you want fewer manual copy-paste steps

How to Claim the Database So It Does Not Expire

By default, the database expires after 72 hours.

If you want to keep it:

  1. open the claim_url
  2. sign in to Neon, or create an account
  3. choose the Neon organization where the database should live
  4. complete the transfer

After you claim it:

  • the expiration is removed
  • the database appears in your Neon console
  • it becomes part of your normal Neon account setup

Important detail from Neon:

  • after claiming, the API connection_string becomes null
  • at that point, use the Neon console for ongoing connection details

Limits of the Free Unclaimed Database

According to the Neon docs, unclaimed databases currently have these limits:

FeatureUnclaimed
Storage100 MB
Transfer1 GB
BranchesNo
Expiration72 hours

If you claim the database, limits move to your Neon plan.

Common Questions

Do I need a Neon account to create the database?

No.

You can create the database immediately without an account.

Do I need to install Postgres locally?

No.

That is one of the biggest advantages of this workflow.

Is this a real Postgres database?

Yes.

Neon’s docs say claimable databases run on Postgres 17.

Should I use the pooled URL or the direct URL?

Use the pooled URL first unless you know you specifically need a direct connection for migrations or tooling.

What happens if I do nothing?

The database expires after 72 hours.

Can I keep the same database?

Yes, but you need to claim it through the claim_url.

Copy-Paste Checklist

If you want the shortest possible version, do this:

  1. Run:
bash
curl -X POST https://neon.new/api/v1/database \
  -H 'Content-Type: application/json' \
  -d '{"ref":"your-app-name"}'
  1. Copy connection_string
  2. Paste it into:
env
DATABASE_URL=...
  1. Optionally create DATABASE_URL_DIRECT by removing -pooler from the hostname
  2. Save claim_url
  3. Restart your app
  4. Claim the database if you want to keep it past 72 hours

One-Sentence Version

If you want a free Postgres database right now, create one with neon.new, paste the returned connection_string into DATABASE_URL, and claim it later only if you want to keep it beyond 72 hours.

Official Links

  • neon.new: https://neon.new/
  • Claimable Postgres docs: https://neon.com/docs/reference/claimable-postgres
  • Neon docs index: https://neon.com/docs/llms.txt