# 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 three 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` | 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`. It works with any ORM or database library (Prisma ORM, Drizzle, Kysely, ...). It isn't the pooled connection string, so read [Use the pooled connection string for application traffic](#use-the-pooled-connection-string-for-application-traffic) before you send production traffic. 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` is set, without printing its value, and that the tools you run next load `.env.local`. If it's still missing, stop and tell me. 5. Connect the ORM or driver the project already uses (ask me if there is none), 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 remind me that `DATABASE_URL` is the direct connection string: production traffic from Vercel Functions should use the pooled one. ``` 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 scales serverless functions automatically. Each new function instance opens a database connection, and with a traditional Postgres setup, that's how you hit connection limits 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`. The variables the integration sets hold the direct connection string, so [add the pooled string](#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`, and `PRISMA_DATABASE_URL` 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] The integration's variables 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, so you can build and deploy with it as is. 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`) instead: 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 a new variable, for example `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. Point your app's database client at the new variable, keep `DATABASE_URL` for Prisma CLI commands, and redeploy. [Rotating your Prisma integration secrets](#rotating-your-prisma-integration-secrets-in-vercel) replaces the integration's own credentials only. It doesn't touch connection strings you create in Console: manage those 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). 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 the pooled string 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