MongoDB Atlas is a fully-managed cloud database service that provides all the features of MongoDB without the operational heavy lifting. This guide will walk you through creating an account and setting up your first cluster.
Click on the "Get started" button in the top right corner.
Complete the registration form with your details:
Check the box to agree to the Terms of Service and Privacy Policy.
After submitting the form, MongoDB will send a verification email to the address you provided.
Click the verification link in the email to complete the registration process.
After verification, you'll be asked to complete your profile:
Click "Finish" to proceed.
After completing your profile, you'll be redirected to the MongoDB Atlas dashboard.
Click on "Build a Cluster" or "Create Cluster" button to start the cluster creation process.
Select your preferred cloud provider (AWS, Google Cloud, or Azure) and region:
Choose the cluster tier:
Leave the default settings for:
For the free tier, additional configuration options are limited.
Click the "Create Cluster" button at the bottom of the page.
The cluster creation process will begin, which typically takes 5-10 minutes.
While your cluster is being created, set up database access:
To connect to your cluster, you need to whitelist IP addresses:
0.0.0.0/0
Once your cluster is ready (status will show as "Active"):
mongodb+srv://username:password@cluster0.mongodb.net/test?retryWrites=true&w=majority
Typically you'll add this to your .env
file as:
MONGODB_URI=mongodb+srv://username:password@cluster0.mongodb.net/test?retryWrites=true&w=majority
Or in your application configuration:
// Node.js example const mongoose = require('mongoose'); mongoose.connect(process.env.MONGODB_URI, { useNewUrlParser: true, useUnifiedTopology: true });
.env
to your .gitignore
fileIf you encounter issues, consult these resources:
You've successfully created a MongoDB Atlas account and set up your first cluster. You can now start using your cloud database for your applications.