Step-by-Step Guide: Creating a Database on MongoDB Atlas

Yasmeen Othman
4 min readSep 25, 2023

--

In this instructional guide, we will guide you through the process of creating your first MongoDB database on Atlas one step at a time. But before we dive into the steps , let’s begin by establishing a solid foundation.

Table of Contents:

  1. Understanding MongoDB & MongoDB Atlas
  2. Why Choose MongoDB Atlas?
  3. Setting Up MongoDB Atlas

2. MongoDB & MongoDB Atlas

MongoDB is a non-relational database management system that stores data in a format similar to JSON called BSON (Binary JSON).

When working with MongoDB, you’ll be taking the decision regarding the storage location for your data (you have two options):
1. Save the data locally on your computer
2. Use the cloud capabilities offered by MongoDB — MongoDB- Atlas.
MongoDB provides developers a free cloud storage , making it an ideal choice for testing and experimenting with your data-driven projects. This flexibility in storage options allows developers to tailor their MongoDB setup to their specific needs and project requirements.

3. Why Choose MongoDB Atlas?

Opting for MongoDB Atlas brings several advantages to the table. When you store your database in the cloud, it becomes easily accessible and shareable with other developers, fostering collaborative work on your projects. Moreover, during the critical production phase, deploying your project becomes a seamless process, reducing the likelihood of encountering deployment-related issues.

Additionally, saving your data to MongoDB Atlas ensures its safety and reduces the risk of data loss in case your local computer experiences a crash. This cloud-based approach offers peace of mind, as your valuable data is securely stored and accessible from anywhere, at any time.🦸🏻‍♂️😎

4. Setting Up MongoDB Atlas:

Let’s get started:

  1. Begin by creating an account on MongoDB Atlas. You can sign up here.
  2. After signing in, you’ll find your initial organization and Project 0, just as shown in the image.
  3. Click on the “create” button to initiate the setup of your very first database.
Step1- create a database

4. When creating the database, choose the free version, and please keep in mind that for Cluster 0, the count should remain at 0. Any additional clusters will incur additional costs. 💰

5. Next, proceed with the Security Quickstart setup. This involves

  • adding a username and password for your database. After setting the credentials, click on the “create a user” button.
create a user
  • Additionally, it’s crucial to specify the IP addresses that are permitted to access your database. You can add your local IP address for added security or use “0.0.0.0/0” as an IP address (though this is less secure).
  • now you are ready to click on “Finish and close”

6. Congratulations! 🎉 You should now receive your first congratulatory message.You’re now ready to navigate to the overview window and retrieve the URI for your MongoDB Atlas instance.

7. Click on the “connect” button to get the URI

8. After clicking on “Connect,” you’ll be presented with various options. Choose the first option if you intend to use MongoDB with your application, such as Node.js.

and you will get the link as follows (make sure to replace the <password> with your own password)

Please note that these steps are accurate as of the time of writing. However, technology platforms can evolve, and MongoDB Atlas may undergo enhancements or changes. Therefore, it’s always a good practice to refer to the most up-to-date documentation or platform-specific resources for any potential updates or modifications to the process.

In our upcoming article, we’ll delve into creating an Express server and guide you on how to establish a connection between your server and MongoDB Atlas.

Stay tuned for the exciting journey ahead🪄, Happy coding! 👩🏻‍💻👨🏻‍💻

--

--