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:
open the claim_url
sign in to Neon, or create an account
choose the Neon organization where the database should live
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:
Feature
Unclaimed
Storage
100 MB
Transfer
1 GB
Branches
No
Expiration
72 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:
Optionally create DATABASE_URL_DIRECT by removing -pooler from the hostname
Save claim_url
Restart your app
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.