Skip to main content

πŸ‘ Deploy a Database Cluster

Now that you have a MongoDB Atlas account, you can create your first cluster. A cluster is a group of at least three servers that store your data. Using a cluster ensures that your data is always available, even if one of the servers fails.

You can create your first database cluster for free. It won't expire, and you will have a 500 MB storage limit. This is enough to get started with MongoDB Atlas.

Create a new cluster​

From the overview page, click on "+ Create."

Overview screenshot
note

If you just created your account, you will automatically be redirected to the cluster creation page and can skip this step.

You will be redirected to the cluster creation page. Here you can choose the cloud provider and region where your data will be stored. You can also choose the type of cluster you want to create. For this tutorial, we will use the free tier.

  1. For the cluster tier, pick M0, which is the free tier. In the Name input box, put the name "DeveloperDay" (one word, no spaces).
  2. Uncheck the Automate security setup box. You will set up security manually in the next steps.
  3. Uncheck the Preload sample dataset box. You will import a dataset later in this tutorial.
  4. Select your favorite cloud provider and the region closest to you.
  5. Finally, click on "Create Deployment."
Create cluster screenshot

Once you're done with the hardest part of the process (the captcha), you will be redirected to the security quickstart.

Security quickstart​

By default, your MongoDB Atlas deployment is completely locked down. You need to configure the network settings and create a user to access your database.

While your deployment is being provisioned, you will see the security quickstart dialog.

Network access​

First, you should Allow Access from Anywhere. You will see a field prepopulated with the IP address 0.0.0.0/0. This means that you can connect to your database from any IP address, including the virtual environment you will use for this lab. Click "Add IP Address" to add this IP address to the network allowlist.

caution

It is dangerous to expose your database to the entire world. Never do this in a real production environment.

Database user​

Next, you need to create a database user. Pick any username and password you want. They will be used when you want to connect to your database. Click "Create Database User" to create the user.

Atlas might create the user automatically for you if you have just created your account. In this case, the username and password will match your Atlas account credentials.

tip

Make sure to remember your username and password. You will need them later.

For the sake of this workshop, it might be preferable to use a simple password that you'll remember over a more secure one.

Don't use any special characters in your password. Even though MongoDB allows some special characters, they might not work well with the tools you'll use later in this workshop.

Manual network access configuration​

If you don't see a button to allow access from anywhere, you should close the dialog and go to the Network Access tab under the Security section in the left sidebar. Click on "Add IP Address," add the IP address 0.0.0.0/0, and click "Confirm."

That's all!​

You have a new database cluster, and you can now connect to it from your application. If everything goes well, you should see your newly created cluster in the database deployment screen.

Screenshot of the database deployment screen