databases (core)10 minutes

Get Started with Neon

Quick Summary

Serverless Postgres with branching and scale-to-zero

Best for: Startups and solo developers who want serverless Postgres with a generous free tier and instant database branching for staging environments
Time to first integration: 10 minutes

📋Prerequisites

  • Node.js 18+ installed
  • A Neon account — sign up here
  • An existing project (Next.js, React, or Node.js recommended)

Setup Steps

4 steps
1

Create a database

Create a project at neon.tech and copy the connection string.

2

Set DATABASE_URL

Add the Neon connection string as an environment variable.

bash
DATABASE_URL=postgresql://user:pass@ep-xxx.neon.tech/dbname
3

Connect

Use the serverless driver on the edge, or node-postgres/Prisma on a server.

typescript
import { neon } from '@neondatabase/serverless' const sql = neon(process.env.DATABASE_URL)
4

Query

Run SQL directly or point your ORM at DATABASE_URL.

typescript
const rows = await sql`SELECT * FROM users`

Related Guides

Setting up a full stack? Check out these complementary guides.

Links