Docs Menu

Docs HomeMongoDB Atlas

Integrate with Vercel

On this page

  • Considerations
  • Add a Vercel Integration
  • Manage a Vercel Integration in the Atlas UI

You can connect your Atlas clusters to applications that you deploy using Vercel.

Use this page to complete the following tasks:

  • Connect Vercel users and teams to organizations in Atlas.

  • Create links from Vercel projects for these users and teams to Atlas clusters.

Vercel integrates with the Next.js network. To learn more about using Next.js with MongoDB, including deploying in Vercel without this official integration, you can also see Integrate MongoDB Into Your Next.js App.

To connect the serverless functions that you deployed in Vercel to Atlas clusters, you can also use the MongoDB Node.js driver or the Mongoose ODM library.

The integration with Vercel requires that you:


You can add a Vercel integration as a personal account user and then add another Vercel integration as a team user.

You can't change the scope of an existing integration from a personal account to a team level account in Vercel.

If you use a personal Vercel account for your MongoDB integration, and want to switch to an integration for a team to the same Atlas organization, you must disconnect an existing integration in Atlas, and add a new integration with a team scope.

You can link one Atlas cluster to more than one project in Vercel.

To configure the integration, you must have one or more projects in your personal or team Vercel account.

The list of Vercel projects that you can choose for the integration depends on the user or team scope.

Vercel deployments use dynamic IP addresses.

To connect to an Atlas cluster, the IP access list of your Atlas cluster must allow all IP addresses ( If Atlas doesn't find an entry for in your Atlas project's IP access list, Atlas adds it on your behalf, as part of the integration workflow.

When you set up the integration, Atlas performs these actions to secure your Vercel connections to the cluster:

  • Creates a MONGODB_URI environment variable that serves as the Atlas cluster's connection string for all Vercel projects that you link this cluster to.

    When your application doesn't specify a database, the MONGODB_URI variable uses /myFirstDatabase as the default database name. Replace this name with your database name, or if you use a library to interface with MongoDB, ensure that your application's code specifies your database name.

  • Creates a database user, vercel-admin-user, in the admin database and grants the built-in readWriteAnyDatabase MongoDB database role to all other non system databases in the cluster.

This procedure allows you to create a new account in Atlas with its organization, project, and user role, and then create a new cluster, or use an existing Atlas account, organization, project, and Atlas cluster for integration with Vercel.

To integrate Vercel applications with Atlas clusters, you begin in the Vercel UI.


Go to MongoDB Atlas Integration in Vercel and click Add integration.

  1. Choose one of the Vercel scopes from the drop-down menu:

    • Personal Account

    • Team

    After you set the scope for your integration, you can't change it. To switch to a scope that differs from your chosen scope, disconnect one integration and create another one using this procedure.

  2. Click Continue.


You can choose specific projects or all projects. You can later edit the integration to change the projects. The project list depends on the user or team scope that you specified in the previous step.

Select one of the following options:

  • All Projects

  • Specific Projects

  1. Choose one of the following options:

    • If you're using your Google Accounts, follow the steps for signing into it, or create a new Google account.

    • If you're using your email, it's already filled in and grayed out.

    • If your company uses federated authentication, use your company's email address. Proceed with the verification steps required for your federated user access.

    • If you already have an Atlas account, click Log in now. See Log in to Your Atlas Account.

  2. Enter your first and last names, and choose a password. A password must contain at least 8 characters, contain unique characters, numbers, or symbols, and not contain your email address. See Register a new Atlas Account.

  3. Click the checkbox I accept the Privacy Policy and the Terms of Service.

    Review the Terms of Service and the Privacy Policy.

  1. Select an Atlas organization from the drop-down, or create a new Atlas organization.

  2. Click Continue.

  3. Confirm access to your Atlas organization.

    Atlas creates an organization for you. Click I Acknowledge to confirm that you grant Vercel access to your Atlas organization.

    To remove access from this Vercel integration to your MongoDB Atlas organization, you must disconnect this integration.

  4. Select an Atlas project to integrate with Vercel from the drop-down, or create a new project.


Atlas sends you a confirmation email with the details of your integration. The integration window closes and you return to the Vercel UI where you can update the Vercel projects in this integration.

To manage the integration with Vercel, use the Integrations page for your organization in Atlas.


To link additional clusters in your organization to projects in Vercel, use the Link clusters button on the Atlas Integrations page for Vercel.


Use this procedure for an already configured integration. To configure an initial integration, see Add a Vercel Integration.


Select your organization from the Organizations menu in the navigation bar.

  1. Click Integrations in the sidebar.

  2. Select Vercel.


Click Link Clusters.

The Add Another Cluster Link with Vercel window opens and shows your Atlas organization.

  1. Select an Atlas project.

  2. In the left drop-down list, select a cluster not linked to Vercel. If your project doesn't have another Atlas cluster, you can create one.

  3. In the right drop-down list, select one or more Vercel projects.

  4. Click Save.

You receive a confirmation email from Atlas with the details of your integration.

A new linked Atlas cluster appears in the linked clusters list.

To link a cluster from another Atlas project in your organization to Vercel, repeat this procedure for that project.

You can add or remove Vercel projects that you linked to an Atlas cluster.


Click Integrations in the sidebar.

  1. Select Vercel.


Atlas displays existing linked Vercel projects.

To edit existing links, in the right-side list, choose a project from the drop-down. You can:

  • Click next to a Vercel project in the list to add it to this cluster's integration.

  • Click to remove some Vercel projects from this integration.


Atlas asks you to confirm that you want to unlink the cluster from the projects. To confirm, click Unlink. Atlas removes the environment variables for Vercel projects that it created when you linked the projects to an Atlas cluster.

If you unlink all projects, Atlas behaves as follows. It:

  • Doesn't remove your data, database users, or IP access lists that you created for this integration.

  • Doesn't delete the cluster, or the integration, even though the Atlas UI might show that you have no linked clusters in your integration. To disable the integration, you must disconnect Vercel.


Before you disconnect Vercel projects from Atlas clusters, to avoid downtime to any applications connected to the same Atlas clusters, verify that the cluster's users and network access rules don't share other projects and applications connected to this Atlas cluster.

  1. Click Integrations in the sidebar.

  2. Select Vercel.


In this step, click to request Atlas to do these optional tasks for you:

  • Delete the database users created as part of this integration

  • Delete the network access rules created as part of this integration


Atlas asks you to confirm that you want to disconnect your Atlas organization from Vercel.

Disconnecting the integration may result in downtime for your Vercel applications and any other applications connecting to the Atlas clusters that you linked to Vercel.

To confirm, enter the words Disconnect Vercel in capital letters and then click Disconnect Vercel.

Atlas removes the integration by removing the environment variables for Vercel projects that it created when you linked the projects to an Atlas cluster.

Vercel also removes the integration and it no longer displays in the Vercel UI.

←  Explore the MongoDB EcosystemManage Billing →
Share Feedback
© 2023 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.