# Vercel (/docs/guides/postgres/vercel) > For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL. Learn how to create Prisma Postgres databases via the Vercel Marketplace and deploy your Next.js, Nuxt, and SvelteKit applications. Location: Guides > Postgres > Vercel The [Vercel Marketplace integration for Prisma Postgres](https://www.vercel.com/marketplace/prisma) connects your Vercel projects with Prisma Postgres instances. When you connect a database to a project, the integration sets four environment variables on each environment you connect: | Variable | Value | | --------------------- | --------------------------------------- | | `DATABASE_URL` | The database's direct connection string | | `POSTGRES_URL` | The same value as `DATABASE_URL` | | `PRISMA_DATABASE_URL` | The same value as `DATABASE_URL` | | `DATABASE_URL_POOLED` | The database's pooled connection string | The direct [connection string](https://www.prisma.io/docs/postgres/database/connecting-to-your-database) has the form `postgres://USER:PASSWORD@db.prisma.io:5432/postgres?sslmode=require`, and the pooled one has the host `pooled.db.prisma.io` instead. Both work with any ORM or database library (Prisma ORM, Drizzle, Kysely, ...). Your app should read the pooled one, and Prisma CLI commands the direct one: see [Use the pooled connection string for application traffic](#use-the-pooled-connection-string-for-application-traffic), which also covers projects that have no `DATABASE_URL_POOLED`. On some older databases, `PRISMA_DATABASE_URL` still holds a hosted Accelerate URL (`prisma+postgres://accelerate.prisma-data.net/...`), which will be [retired on December 1, 2026](https://www.prisma.io/docs/postgres/database/switch-from-accelerate). Read `DATABASE_URL` in new code. ## Set up with a coding agent [#set-up-with-a-coding-agent] A coding agent can install the integration, create the database, and connect it to your project with the [Vercel CLI](https://vercel.com/docs/cli/integration). Install the CLI and sign in first (`npm i -g vercel@latest`, then `vercel login`), then copy this prompt into your agent from the root of your project: ### Set up Prisma Postgres on Vercel ```text Set up Prisma Postgres for this project through the Vercel Marketplace integration, following https://www.prisma.io/docs/guides/postgres/vercel.md. 1. Load the prisma-postgres-setup skill and follow its Vercel Marketplace reference. If it isn't installed, run `npx skills add prisma/skills --skill prisma-postgres-setup` first. 2. Check that the project is linked to Vercel (`vercel link`). Run `vercel integration list` and reuse a Prisma Postgres database that is already connected. 3. Otherwise run `vercel integration add prisma --help` to read the regions and plans, then `vercel integration add prisma/prisma-postgres --name --no-env-pull` (step 4 pulls the variables). Use the `free` plan unless I choose a paid one. If the CLI asks me to accept Prisma's terms in the browser, tell me and wait. 4. Run `vercel env pull` even if `DATABASE_URL` is already set, because a local value can point at another database. It writes the linked project's Development variables to `.env.local` and keeps variables that exist only in that file. If `.env.local` already exists and the Vercel CLI didn't create it, the pull asks before overwriting it (without a terminal, it stops and asks for `--yes`): ask me first. Then check that `DATABASE_URL` and `DATABASE_URL_POOLED` are set, without printing their values, and that the tools you run next load `.env.local`. If `DATABASE_URL` is still missing, stop and tell me. If `DATABASE_URL_POOLED` is in `.env.local` but the project's Development variables don't include it (`vercel env ls development | grep -qw DATABASE_URL_POOLED` fails), the pull kept an old local value: ask me before using it. 5. Connect the ORM or driver the project already uses (ask me if there is none). At runtime, read `DATABASE_URL_POOLED` and fall back to `DATABASE_URL`. Read the direct `DATABASE_URL` instead if the app uses the Prisma Postgres serverless driver (`@prisma/ppg` or `@prisma/adapter-ppg`), which takes the direct connection string, depends on session state (`LISTEN`/`NOTIFY`, temporary tables, session-level `SET`, advisory locks), or runs queries longer than 10 minutes, which the pooler stops. Prisma CLI commands keep using `DATABASE_URL`. Run one read-only query such as `select 1`, and show me the result. 6. Tell me which environments the database is connected to, and check by name that each of them has `DATABASE_URL_POOLED` (`vercel env ls | grep -qw DATABASE_URL_POOLED`), without printing the listing. Where it's missing, tell me to add the pooled connection string before production traffic, as the guide describes. ``` Unless you pass `-e `, `vercel integration add` connects the new database to the linked project's production, preview, and development environments, then runs `vercel env pull` unless you pass `--no-env-pull`, as the prompt does. One database on all three environments means local development, preview deployments, and production share the same data. To keep them apart, create one database per environment with `-e`. If Prisma isn't installed on your Vercel team yet, the CLI asks you to accept the integration's terms in the browser. Your agent can't do that step for you. ## Why Prisma Postgres works well on Vercel [#why-prisma-postgres-works-well-on-vercel] Vercel starts more function instances as traffic grows, and each new instance opens its own database connections, so with a traditional Postgres setup you hit the database's connection limit under load. Every Prisma Postgres database comes with a managed [connection pooler](https://www.prisma.io/docs/postgres/database/connection-pooling), so you don't configure pgBouncer or run a separate pooler: your app connects to the pooled endpoint, `pooled.db.prisma.io`, whose connection string the integration sets as `DATABASE_URL_POOLED`. [Point your app at it](#use-the-pooled-connection-string-for-application-traffic) before production traffic. ## Features [#features] * Create and use Prisma Postgres instances without leaving the Vercel dashboard. * Connection strings set as environment variables on the environments you connect: production, preview, and development by default. * Simplified environment configuration for your Vercel project. * Billing workflows to up-/ and downgrade your Prisma Postgres pricing plan. * Ready-to-deploy fullstack templates for Next.js, Nuxt, SvelteKit and with various ORMs and DB libraries. ## Templates [#templates] The fastest way to start with Prisma Postgres on the Vercel Marketplace is one of the templates: * [Prisma ORM + NextAuth Starter](https://vercel.com/templates/next.js/prisma-postgres) * [Postgres + Kysely Next.js Starter](https://vercel.com/templates/next.js/postgres-kysely) * [Postgres + Drizzle Next.js Starter](https://vercel.com/templates/next.js/postgres-drizzle) * [Postgres + SvelteKit Starter](https://vercel.com/templates/svelte/postgres-sveltekit) ## Usage [#usage] ### Install the extension [#install-the-extension] To install the extension, click **Install** at the top of the [Prisma Postgres integration page](https://www.vercel.com/marketplace/prisma). The integration will now show up on your list of integrations, e.g. `https://vercel.com//~/integrations`. ### Create a new database [#create-a-new-database] Once installed, you can navigate to the **Storage** tab and click **Create Database**. Select **Prisma Postgres** and click **Continue**. Then select the **Region** for the database and a **Pricing Plan**, and click **Continue** again. Finally, give the database a **Name** and click **Create**. The database is now ready and can be connected to your Vercel projects. ### Connect database to Vercel project [#connect-database-to-vercel-project] In your Vercel project, you can now click the **Storage** tab, select the database you just created and then click **Connect**. This sets `DATABASE_URL`, `POSTGRES_URL`, `PRISMA_DATABASE_URL`, and `DATABASE_URL_POOLED` in that project and enables your application to access your newly created Prisma Postgres instance. When you connect, you choose the environments that get the variables. From the CLI, `vercel integration add` and `vercel integration resource connect` connect production, preview, and development unless you pass `-e`. Existing deployments don't get new variables, so redeploy after you connect. ### Use the pooled connection string for application traffic [#use-the-pooled-connection-string-for-application-traffic] `DATABASE_URL`, `POSTGRES_URL`, and `PRISMA_DATABASE_URL` hold the direct connection string (host `db.prisma.io`). It works for your app, for Prisma CLI commands such as migrations, and for Prisma Studio. Direct connections are capped per plan: 10 on Free and Starter, and 5 of those are reserved for platform operations (see [Connection limits](https://www.prisma.io/docs/postgres/database/connection-pooling#connection-limits)). Vercel Functions scale out, and each instance opens its own connection, so under load your app should connect through the pooled connection string (host `pooled.db.prisma.io`), which the integration sets as `DATABASE_URL_POOLED`. Read it in your app's database client and fall back to `DATABASE_URL`. Keep `DATABASE_URL` for Prisma CLI commands, for the [serverless driver](https://www.prisma.io/docs/postgres/database/serverless-driver) (`@prisma/ppg`), which takes the direct connection string, for workloads that depend on session state, such as `LISTEN`/`NOTIFY` or temporary tables, and for queries that run longer than 10 minutes (see [When to use each connection type](https://www.prisma.io/docs/postgres/database/connection-pooling#when-to-use-each-connection-type)): ```ts const connectionString = process.env.DATABASE_URL_POOLED ?? process.env.DATABASE_URL; ``` If your project has no `DATABASE_URL_POOLED`, the database was created before the integration started setting it on October 29, 2026. Add it yourself: 1. Run `vercel integration open prisma` to open Prisma Console, signed in through Vercel. 2. Select the database and create a connection string. Console shows a pooled and a direct string. See [Get your connection strings](https://www.prisma.io/docs/postgres/database/connecting-to-your-database#get-your-connection-strings). 3. Add the pooled string to your Vercel project as `DATABASE_URL_POOLED`, in the dashboard or with `vercel env add DATABASE_URL_POOLED ` for each environment the database is connected to. Don't overwrite the variables the integration manages. 4. Redeploy. [Rotating your Prisma integration secrets](#rotating-your-prisma-integration-secrets-in-vercel) replaces the credentials in the variables the integration sets. A pooled string you added yourself in step 3 isn't one of them: manage it in Console. ### Viewing and editing data in Prisma Studio [#viewing-and-editing-data-in-prisma-studio] To view and edit the data in your Prisma Postgres instance, you can use the local version of [Prisma Studio](https://www.prisma.io/docs/studio). Studio ships with the Prisma ORM 7 CLI and works with Prisma ORM 7 and Prisma ORM 8 databases alike. Point it at the connection string from the **Storage** tab: #### bun ```bash bunx prisma@prev studio --url="$DATABASE_URL" ``` #### pnpm ```bash pnpm dlx prisma@prev studio --url="$DATABASE_URL" ``` #### yarn ```bash yarn dlx prisma@prev studio --url="$DATABASE_URL" ``` #### npm ```bash npx prisma@prev studio --url="$DATABASE_URL" ``` ## Using with Next.js [#using-with-nextjs] If you're building a Next.js app and want a step-by-step walkthrough covering the contract, migrations, querying from Server Components, and deploying, see the [Next.js guide](https://www.prisma.io/docs/guides/frameworks/nextjs). To deploy a Next.js app that uses Prisma ORM to Vercel, follow [Deploy to Vercel](https://www.prisma.io/docs/guides/deployment/vercel). It covers the contract files, applying migrations before the deploy, keeping pages that query dynamic, and Vercel's `attachDatabasePool`. The key things to set up on the Vercel side: ### Ensure your project uses the correct environment variable [#ensure-your-project-uses-the-correct-environment-variable] The generated `src/prisma/db.ts` reads `process.env.DATABASE_URL`, which is the variable the **Connect** step above sets on your Vercel project. Nothing else needs to be configured for the runtime to find the database. `DATABASE_URL` is the direct connection string: before production load, point `db.ts` at `DATABASE_URL_POOLED` as described in [Use the pooled connection string for application traffic](#use-the-pooled-connection-string-for-application-traffic). ### Commit the emitted contract files [#commit-the-emitted-contract-files] Prisma ORM has no build-time generate step. `npx prisma contract emit` writes `src/prisma/contract.json` and `src/prisma/contract.d.ts`, and those files are committed with your code, so Vercel's `next build` needs no `postinstall` hook. Apply schema changes to the database before you deploy, with `npx prisma db migrate` from your machine or CI. See [Applying a migration](https://www.prisma.io/docs/orm/migrations/applying-a-migration). > [!NOTE] > Using Prisma ORM 7? > > For a Prisma ORM 7 project, keep the `prisma.config.ts` that reads `DATABASE_URL` and add `"postinstall": "prisma generate"` to `package.json` so Prisma Client is generated on every deploy. See the [Prisma ORM 7 Next.js guide](https://www.prisma.io/docs/guides/v7/frameworks/nextjs), and [Release status](https://www.prisma.io/docs/orm/release-status) for where Prisma ORM 8 stands and how to pin Prisma ORM 7. ## Billing and pricing [#billing-and-pricing] Prisma Postgres uses [usage-based pricing](https://www.prisma.io/pricing) based on operations and storage. The same plans and rates apply when you create a database via the Vercel Marketplace, and your Prisma Postgres usage is billed through your Vercel account. To change your plan, see [How do I upgrade my plan if I am using Prisma Postgres via Vercel?](https://www.prisma.io/docs/postgres/faq#how-do-i-upgrade-my-plan-if-i-am-using-prisma-postgres-via-vercel) in the Prisma Postgres FAQ. ## Security [#security] ### Rotating your Prisma integration secrets in Vercel [#rotating-your-prisma-integration-secrets-in-vercel] In security incidents (like [this Vercel security bulletin](https://vercel.com/kb/bulletin/vercel-april-2026-security-incident)) or as a regular security practice, you may need to rotate your Prisma integration secrets. This process generates new authentication credentials for your database connection while keeping your data intact. Follow these steps to rotate your Prisma integration secrets in Vercel: 1. Open your browser and go to your specific project (e.g., `https://vercel.com/your-team-name/your-project-name`) 2. Click **"Integrations"** in the left sidebar menu to see all connected marketplace apps 3. Click **"Prisma"** to open the Prisma integration management page 4. Under **"Installed Products"**, click on the specific database whose secrets you want to rotate 5. Click the **"Settings"** tab and scroll down to find the security section 6. Click the **"Rotate Secrets"** button to open the rotation dialog 7. Configure rotation settings: * **Delay period**: Enter `0` for immediate rotation (urgent incidents) or any other number for delayed rotation in hours (planned maintenance) * **Rotation scope**: Select which secrets to rotate (database connection secrets, API tokens, etc.) 8. Click **"Rotate Secrets"** to confirm and wait for the success message 9. Redeploy your applications: This is critical! After rotation completes: * Immediately redeploy all applications using this database (Vercel will prompt you) * Click **"Redeploy"** for each affected application * Verify connections work after redeployment * Monitor application logs for connection errors Reach out to our [Discord community](https://pris.ly/discord) or on [X](https://pris.ly/x) if you need assistance with this process. ## Related pages - [`Firebase Studio`](https://www.prisma.io/docs/guides/postgres/idx): Learn how to use Prisma Postgres in the online Firebase Studio - [`Fly.io`](https://www.prisma.io/docs/guides/postgres/flyio): Learn how to deploy applications using Prisma Postgres to Fly.io - [`Netlify`](https://www.prisma.io/docs/guides/postgres/netlify): Learn how to connect Prisma Postgres to your Netlify sites with the official Netlify extension and deploy your applications with it - [`Viewing data`](https://www.prisma.io/docs/guides/postgres/viewing-data): Viewing and editing data in Prisma Postgres via Prisma Studio or other database GUIs - [`VS Code`](https://www.prisma.io/docs/guides/postgres/vscode): The Prisma VS Code extension provides a management UI for Prisma Postgres and agent-mode support for GitHub Copilot