Docs
PostgreSQL on Vercel

PostgreSQL on Vercel

Our boilerplate templates comes with PostgreSQL integration. In this part of the documentation, we are going to show you you can integrate Vercel Postgres with your boilerplate template.

Note: If you want to use other providers you can do so. For demonstration purpose we are using Vercel PostgreSQL (opens in a new tab)

Getting the Database URL

Before we integrate the database in the template first you have to deploy (opens in a new tab) it to Vercel.

Once you deploy it follow the instruction to create the database.

  1. Go to the Storage tab.

database

  1. Now Scroll down and click on the Create New Database button.

database

After that select Postgres and then the Continue button.

database

Now do the following to create a new database:

  1. Enter the database name. The name can only contain alphanumeric letters, "_" and "-" and can't exceed 32 characters.
  2. Select a region.
  3. Click Create.

The Database is created successfully.

Because we created the database in a project, we won’t have to add the environment variables manually to Vercel. It’ll be added automatically.

Now we have to pull the environment variables to the local project.

To do that, first of all, you have to install Vercel CLI

npm i -g vercel@latest

After that run this command to pull the .env variables.

vercel env pull .env

Note: You have to connect the local project with Vercel for this command to work. Follow this instruction (opens in a new tab) to link the project.

Migrate the Schema

Migrate the Schema