Vercel is a development platform that simplifies application deployments. Vercel has a marketplace for developers to discover software packages and provision applications.
Use the instructions on this page to:
Get started with Vercel and MongoDB Atlas and build your next project with MongoDB Atlas.
Choose from Free, Dedicated, and Flex MongoDB clusters, with options for every use case.
Native Integration and Connectable Accounts
You can integrate with Vercel in the following ways:
Native Integration
In this mode, you locate MongoDB Atlas in Vercel Marketplace, and create a new MongoDB Atlas account with billing conducted through Vercel. A Native Integration of MongoDB Atlas in Vercel allows you to:
Provision Atlas resources directly from the Vercel dashboard, with billing managed through your Vercel account. You can also directly access resources in Atlas through a provisioned linked account.
Deploy MongoDB Atlas clusters for new and existing Vercel applications.
After you create MongoDB Atlas clusters, Vercel adds your Atlas cluster credentials and other settings to your Vercel environments. To learn more about the Native Integration, see Vercel Native Integration.
Connectable Accounts Integration
This mode guides you through setting up an account in Atlas to connect your existing Vercel projects.
The Connectable Accounts Integration mode allows you to link an existing Atlas account to your Vercel account, but requires that you manage your Atlas account, billing, and creation of resources outside of the Vercel UI. By comparison, the Native Integration mode allows you to create and manage Atlas resources directly from the Vercel UI, with billing managed through your Vercel account.
Important
While the Connectable Accounts Integration continues to be supported, we recommend that you use it only to connect existing Atlas resources to Vercel. To use Vercel and MongoDB Atlas together for new Atlas resources, and for the best developer experience, use the Vercel Native Integration.
Find Atlas in Vercel
If you are a Vercel user with any role, you can discover Atlas through the following methods:
Log into the Vercel UI.
Under the Overview tab locate the Add new button in the upper right corner and from the drop-down, select Integration.
Considerations
Accounts in Vercel (Personal or Team)
The integration with Vercel requires that you:
Create a new personal account or create a new team in Vercel.
Use an existing personal or team account in Vercel.
Projects in Vercel
You can link one Atlas cluster to more than one project in Vercel.
If you create a Native Integration of Atlas in Vercel, Atlas creates a new Vercel-managed organization and project in Atlas for you.
If you use a Connectable Accounts Integration of Atlas with Vercel, you must have one or more projects in your personal or team Vercel account before you can link them to Atlas clusters.
The list of Vercel projects that you can choose for the integration depends on the user or team scope.
IP Access Lists in Atlas and IP Allow Lists in Vercel
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 (0.0.0.0/0). If Atlas doesn't find an entry for 0.0.0.0/0 in your Atlas project's IP access list, Atlas adds it on your behalf, as part of the integration workflow.
If you use a Native Integration of Atlas with Vercel, Atlas creates a database user in the following format:
Vercel-Admin-[name of resource]
in the admin database and grants the built-in readWriteAnyDatabase MongoDB database role to all other non system databases in the Atlas cluster. For example, if your Vercel resource is namedmy-first-atlas-cluster
, the database user that Atlas creates isVercel-Admin-my-first-atlas-cluster
.If you set up the Connectable Accounts Integration of Atlas with Vercel, Atlas secures your Vercel connections to the cluster as follows: Atlas 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.Atlas 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 Atlas cluster.
Vercel Native Integration
You can create a Native Integration of Atlas in Vercel Marketplace to provision Atlas resources directly from the Vercel dashboard, with billing managed through your Vercel account. You can also directly access resources in Atlas through a provisioned linked account.
Atlas provisions the account for you if you don't have one. The Atlas account is linked to the Vercel installation. You have separate credentials for logging into Atlas.
Considerations: Native Integration
The following considerations apply to the Native Integration of Atlas in Vercel. In addition, see Considerations that apply to both integration modes.
Resource Mapping
A "team installation" in Vercel maps to an organization in Atlas. An installed product (resource) in Vercel maps to a project and cluster in Atlas.
API Access
Vercel requires programmatic access to Atlas APIs to create and manage resources on behalf of users and to propagate environmental changes.
User Provisioning and Account Linking
Atlas provisions new Atlas user accounts for Vercel users, links existing accounts, and sends a password reset email if you don't configure Atlas credentials. User authentication requires Atlas credentials to access Atlas.
The user who initially installs the Atlas Native Integration for the Vercel team becomes the Atlas
Organization Owner
.Accessing |service| from Vercel
You can navigate to Atlas UI from Vercel via an Open in Atlas button. After logging in with your Atlas credentials, Atlas redirects you to the corresponding Atlas resource.
Users with existing Atlas accounts. When accessing Atlas from Vercel, Vercel prompts users with existing Atlas accounts to confirm linking their Atlas account to their Vercel installation. After the users confirm the linkage and log in with Atlas credentials to prove their identity, Atlas links the users' Atlas accounts to their Vercel installation.
New users. Atlas provisions an account for new users and sends a password reset email so that users can configure their passwords and prove their identity. Once Atlas obtains the user's credentials, Atlas links the user's Atlas account to their Vercel installation and grants this user the
Organization Owner
role in Atlas. Atlas keeps organization's permissions in line with the permissions in Vercel. Vercel's "Admin" and "User" roles map toOrganization Owner
andOrganization Read Only
roles in Atlas, respectively.
If any user in the Vercel team installs additional Atlas clusters using the Native Integration, Atlas doesn't automatically add these users to the Atlas organization created for the Vercel team. The Atlas organization owner must ensure that all Vercel team users who need access to the Atlas organization have it. This also applies to new Vercel team users who join the Vercel team after the initial installation of the Native Integration.
Use one of the following methods to ensure that Atlas adds additional Vercel team's users to the Atlas Organization:
Vercel team users can access the Atlas organization in the Atlas UI through the Vercel UI. if they're not already Atlas users, Atlas provisions accounts for them, with assignment to the Atlas organization for the Native Integration.
The Atlas Organization owner can invite Atlas users to the Atlas Organization.
Environment Variables
The Native Integration automatically configures the
MONGODB_URI
environment variable for secure database connections. For the full list of environment variables, see the Vercel UI for the Native Integration of Atlas.Billing
The Vercel Native Integration creates a new Atlas Organization from the Vercel UI which is automatically connected to a Vercel Marketplace billing plan as the active payment method for the Atlas Organization. Billing occurs per one Atlas organization and includes a collective bill for all MongoDB Atlas clusters and services in the Organization. In Vercel and Atlas, you can see a confirmation of Vercel Marketplace billing for the Atlas Organization, as well as daily usage costs.
Security
Atlas ensures secure connections via SCRAM authentication with IP allowlists for Atlas clusters that you create through the Native Integration in Vercel.
Deletion or Uninstallation of the Native Integration
After uninstalling a Vercel integration, we recommend that the Atlas Organization owner ensures that access assignments and billing methods are up-to-date, and removes stale or unwanted access to prevent automated reminders from MongoDB regarding overdue billing payments. Atlas submits a final Vercel invoice for the Atlas to Vercel, and removes the Vercel Marketplace payment method from the Atlas Organization.
This invoice is not a final Atlas invoice, as there might still be additional charges incurred by the Organization after uninstallation for the most recent usage that might not have been billed for yet. You are responsible for adding a new payment method to the Organization to ensure any outstanding usage can be paid for.
You can't uninstall or unlink the Native Integration from the Atlas UI, although you can always delete your resources in Atlas. If you delete a Vercel-linked cluster, this is reflected in the Vercel UI.
Getting Started in Vercel UI for Next.js
The Vercel UI for the Native Integration includes instructions for getting started with Next.js and Atlas.
Deployment templates
The Vercel UI for the Native Integration includes deployment templates. These templates include example code and configuration files to help you get started with your Atlas projects in Vercel.
Add a Native Integration
To add the MongoDB Atlas Native Integration in Vercel:
Install the MongoDB Atlas Native Integration.
Go to Vercel Marketplace and use search or left-side category filter for Storage to locate MongoDB Atlas in the list of Native Integrations.
Click Install in the MongoDB Atlas page for the integration, or click Install in the upper right corner of the Vercel UI page for the integration.
Choose a cluster tier.
Choose a Free, Flex, or Dedicated Atlas cluster:
Free ($0, Storage: 512 MB, RAM: Shared, vCPU: Shared)
Flex ($0.011/hour, Storage: Up to 5 GB, RAM: Shared, vCPU: Shared)
Dedicated ($0.08/hour, Storage: 10 GB, RAM: 2 GB, vCPU: 2xCPUs)
Important
Free clusters are available on all installation plans. Flex and Dedicated clusters are available only on Paid installation plans.
Choose a cluster region.
A list of Vercel regions displays. These regions map to MongoDB Atlas regions in most cases. If you choose a Vercel region that doesn't have a corresponding Atlas region, Atlas chooses the closest region to the Vercel region that you selected.
Select an installation plan: Free or Paid.
Free plan $0
No credit card is required. You can only create Free MongoDB Atlas clusters with this plan.
Paid plan
Credit card is required. You can create Free, Flex, and Dedicated clusters with this plan. You'll only be billed for Flex and Dedicated clusters.
If you choose a Flex or Dedicated Atlas cluster, the Free plan is grayed out. If any member of your Vercel team uses this Native Integration with a Free plan and chooses to create a Flex or Dedicated cluster, the plan changes to a Paid plan. Even if you uninstall a MongoDB Atlas cluster that isn't free, the plan remains as a Paid plan. To change the plan to a Free plan, uninstall the Native Integration and then install it again choosing a Free cluster and a Free plan. To learn how to uninstall any Native Integration, see the Vercel documentation.
Now you can use the Native Integration of Atlas in Vercel to:
Connect to a Vercel project.
Pull your latest environment variables.
If you no longer need this MongoDB Atlas cluster, you can uninstall the Native Integration and by doing so delete a MongoDB Atlas database. For instructions, see the Vercel documentation.
You can also delete the database (the resource), without uninstalling the whole integration. This is useful in cases when you want to keep the integration around to create other resources in the future, or if you have other resources in the same integration.
If you delete a Vercel-linked Atlas cluster, any projects that you linked to this cluster in Vercel will no longer have access to this database cluster. Before proceeding with the uninstallation and deletion of the Atlas cluster, ensure that this Atlas cluster is no longer in use by any projects or application.
Contact Support
If you run into issues while using a Vercel Native Integration with MongoDB Atlas, contact Vercel Integration Support at MongoDB vercel-integation-support@mongodb.com.
Add a Connectable Accounts Integration
Note
All the procedures in this section are deprecated. The existing Connectable Accounts integrations continue to work. For new integrations, use the Native Integration with Vercel instead.
This procedure allows you to use an existing Atlas account, organization, project, and Atlas cluster for integration with Vercel.
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.
To integrate Vercel applications with Atlas clusters, you begin in the Vercel UI.
Note
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.
To switch from a MongoDB Connectable Accounts Integration for a personal Vercel account to an integration with a team scope in the same Atlas organization, disconnect an existing integration in Atlas, and add a new integration with a team scope.
Navigate to the MongoDB Atlas integration.
Go to MongoDB Atlas Integration in Vercel and click Add integration.
Choose the scope of your integration (user or team).
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.
Click Continue.
Select Vercel projects to link to an Atlas cluster.
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
Create your MongoDB Account, if you don't already have one.
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.
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.
Click the checkbox I accept the Privacy Policy and the Terms of Service.
Review the Terms of Service and the Privacy Policy.
Select an Atlas organization to integrate with Vercel.
Select an Atlas organization from the drop-down, or create a new Atlas organization.
Click Continue.
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.
Select an Atlas project to integrate with Vercel from the drop-down, or create a new project.
Create a new Free tier cluster, or link an existing cluster to one or more Vercel projects.
If you already have an Atlas account, you can choose an existing organization and project, and then choose an existing cluster.
Ensure that you have the Atlas Project Owner
role.
Choose an Atlas cluster from the drop-down on the left side of the mapping.
Choose one or more Vercel projects from the drop-down on the right side. You can map one Atlas cluster to one or more Vercel projects. The drop-down menu shows one project, or all projects, depending on what you chose for this integration earlier in this procedure. You can later link more Vercel projects to the same Atlas cluster in this integration.
If the selected project doesn't have the 0.0.0.0./0 entry in the Atlas access list, Atlas asks you to acknowledge that you are creating an Atlas cluster with full access due to dynamic IP addresses in Vercel. Atlas sends you an email with this information.
Create a new cluster if you don't have an Atlas cluster. You can later modify the cluster that you created.
Ensure that you have the Atlas
Project Owner
role.Atlas creates a new free tier cluster, and links it to the Vercel projects you selected. You can later link more Vercel projects to the same Atlas cluster.
Click to acknowledge these statements:
The IP Access list contains 0.0.0.0/0, which opens inbound access to Atlas clusters within selected Atlas projects to all IP addresses.
Your Vercel deployment requires this access because it uses dynamic IP addresses to connect to Atlas.
Manage a Connectable Accounts Integration
Note
All the procedures in this section are deprecated. The existing Connectable Accounts integrations continue to work. For new integrations, use the Native Integration with Vercel instead.
To manage the Connectable Accounts integration with Vercel:
In Atlas, go to the Organization Settings page.
WARNING: Navigation Improvements In Progress
We're currently rolling out a new and improved navigation experience. If the following steps don't match your view in the Atlas UI, see the preview documentation.
If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.
Click the Organization Settings icon next to the Organizations menu.
The Organization Settings page displays.
Go to the Organization Integrations page.
Click Integrations in the sidebar.
The Organization Integrations page displays.
Link Another Atlas Cluster to the Connectable Accounts Integration
Note
All the procedures in this section are deprecated. The existing Connectable Accounts integrations continue to work. For new integrations, use the Native Integration with Vercel instead.
To link additional clusters in your organization to projects in Vercel:
Note
Use this procedure for an already configured Connectable Accounts integration.
In Atlas, go to the Organization Settings page.
WARNING: Navigation Improvements In Progress
We're currently rolling out a new and improved navigation experience. If the following steps don't match your view in the Atlas UI, see the preview documentation.
If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.
Click the Organization Settings icon next to the Organizations menu.
The Organization Settings page displays.
Go to the Organization Integrations page.
Click Integrations in the sidebar.
The Organization Integrations page displays.
Link another Atlas cluster to one or more Vercel projects.
Click Link Clusters.
The Add Another Cluster Link with Vercel window opens and shows your Atlas organization.
Select an Atlas project.
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.
In the right drop-down list, select one or more Vercel projects.
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.
Edit or Remove Links to Atlas Clusters
Note
All the procedures in this section are deprecated. The existing Connectable Accounts integrations continue to work. For new integrations, use the Native Integration with Vercel instead.
You can add or remove Vercel projects that you linked to an Atlas cluster.
In Atlas, go to the Organization Settings page.
WARNING: Navigation Improvements In Progress
We're currently rolling out a new and improved navigation experience. If the following steps don't match your view in the Atlas UI, see the preview documentation.
If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.
Click the Organization Settings icon next to the Organizations menu.
The Organization Settings page displays.
Go to the Organization Integrations page.
Click Integrations in the sidebar.
The Organization Integrations page displays.
To add or remove some Vercel projects, click Edit next to the linked Atlas project.
Atlas displays existing linked Vercel projects.
Edit existing links, in the right-side list, choosing 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.
To remove links to all Vercel projects, click Unlink next to the linked Atlas project.
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.
Disconnect a Vercel Integration
Note
All the procedures in this section are deprecated. The existing Connectable Accounts integrations continue to work. For new integrations, use the Native Integration with Vercel instead.
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.
In Atlas, go to the Organization Settings page.
WARNING: Navigation Improvements In Progress
We're currently rolling out a new and improved navigation experience. If the following steps don't match your view in the Atlas UI, see the preview documentation.
If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.
Click the Organization Settings icon next to the Organizations menu.
The Organization Settings page displays.
Go to the Organization Integrations page.
Click Integrations in the sidebar.
The Organization Integrations page displays.
Confirm that you want to disconnect this Vercel 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.
After you disconnect the Vercel integration, if you haven't deleted users or access lists, you can:
Note
When you remove an integration in the Vercel UI, Atlas also removes the integration and you don't need to disconnect the integration in the Atlas UI.