---
title: "Postgres Next.js Starter"
description: "Simple Next.js template that uses a Postgres database."
url: "https://vercel.com/templates/next.js/postgres-starter"
links:
  repository: "https://github.com/vercel/examples/tree/main/storage/postgres-starter"
  demo: "https://postgres-starter.vercel.app/"
  deploy: "https://vercel.com/new/clone?demo-title=Postgres+Next.js+Starter&demo-description=Simple+Next.js+template+that+uses+a+Postgres+database.&demo-url=https%3A%2F%2Fpostgres-starter.vercel.app%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F6nJ3m6LiIjo9BHZj04m1G2%2Fa2d7af418cfc1c9d9ee5a148886c63a9%2FScreenshot_2025-02-10_at_08.40.11.png&project-name=Postgres+Next.js+Starter&repository-name=postgres-starter&repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fexamples%2Ftree%2Fmain%2Fstorage%2Fpostgres-starter&from=templates&skippable-integrations=1&products=%5B%7B%22type%22%3A%22integration%22%2C%22group%22%3A%22postgres%22%2C%22protocol%22%3A%22storage%22%7D%5D"
---

# Postgres Next.js Starter

Simple Next.js template that uses a Postgres database.

# Postgres Next.js Starter

Simple Next.js template that uses a Postgres database.

## Demo

https://postgres-starter.vercel.app/

## How to Use

You can choose from one of the following two methods to use this repository:

### One-Click Deploy

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples):

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fexamples%2Ftree%2Fmain%2Fstorage%2Fpostgres-starter&project-name=postgres-starter&repository-name=postgres-starter&demo-title=Vercel%20Postgres%20Next.js%20Starter&demo-description=Simple%20Next.js%20template%20that%20uses%20Vercel%20Postgres%20as%20the%20database.&demo-url=https%3A%2F%2Fpostgres-starter.vercel.app%2F&demo-image=https%3A%2F%2Fpostgres-starter.vercel.app%2Fopengraph-image.png&products=%5B%7B%22type%22%3A%22integration%22%2C%22group%22%3A%22postgres%22%7D%5D)

### Clone and Deploy

Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [pnpm](https://pnpm.io/installation) to bootstrap the example:

```bash
pnpm create next-app --example https://github.com/vercel/examples/tree/main/storage/postgres-starter
```

Once that's done, copy the .env.example file in this directory to .env.local (which will be ignored by Git):

```bash
cp .env.example .env.local
```

Then open `.env.local` and set the environment variables to match the ones in your Vercel Storage Dashboard.

Next, run Next.js in development mode:

```bash
pnpm dev
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples) ([Documentation](https://nextjs.org/docs/deployment)).

## Related Templates

### [Postgres SvelteKit Starter](https://vercel.com/templates/svelte/postgres-sveltekit)

Simple SvelteKit template that uses a Postgres database.

### [Postgres + Kysely Next.js Starter](https://vercel.com/templates/next.js/postgres-kysely)

Simple Next.js template that a Postgres database and Kysely as the query builder.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
