There are a total of eight steps that we will follow to install MongoDB. These steps will start with how to download MongoDB. Afterwards, we will look at how to install MongoDB.
Before diving into our tutorial, let’s have a look at the topics that we are going to cover in this tutorial:
Steps to Follow to Install MongoDB
- Go to the link:
- Download MongoDB Community Server. You will see the installation of the 64-bit version for Windows
- After downloading the setup, open the MSI file
- Click on Next on the setup screen
- Accept the End-User License Agreement
- Click on Next
- On the next screen, click on the Complete button to install MongoDB components. If you choose the custom option, then you can install selective components and you can change the location of the installation if needed
Have you got more queries? Come to our Community and get them clarified today!
- Now, select Run service as Network Service user
- Copy the Data Directory location. You will need this in a later step
- Click on Next
- Click on the Install button to start installing MongoDB
- At this point, the installation process starts. Once it is completed, click on Next
- Finally, click on Finish to complete installation
To verify whether the installation has been completed successfully, you have to open a Command Prompt and write mongo, and then you have to check MongoDB versions. If they are shown correctly, it means that MongoDB is installed successfully.
Go for this in-depth job-oriented MongoDB Training Course now!
‘Hello World’ Code in MongoDB
Installing RoboMongo for MongoDB
To write MongoDB commands, we need a tool; therefore, we use RoboMongo. We can also use MongoDB Compass for that, but in this tutorial, we have used RoboMongo.
RoboMongo is free and open-source software that supports all three operating systems: Windows, Linux, and Mac OS. Now, it depends on you which tool you want to use.
Steps to Download and Install RoboMongo
- Go to the link: https://robomongo.org/download
- Click on the Download Robo 3T button and download the setup depending upon your PC’s architecture. Here, it is the 64-bit version
- In the new window, select your operating system
- Once you select the OS, click on the version (i.e., 64-bit version)
- You have downloaded the setup. Now, click on the .exe file
- Click on Next
There are more on MongoDB in Intellipaat’s MongoDB blog!
- In the new window, click on I Agree for accepting the license agreement’s terms and conditions
- Click on Install and the installation process starts
- In the new window, you need to create your new connection, but before that go to the Command Prompt and write mongod to start MongoDB
- Later on, press on Create
- In the pop-up window, name your connection
- Click on Save and then on Connect
Check out the top MongoDB Interview Questions to learn what is expected from MongoDB professionals!
- Once the connection is created, right-click on it and open the new shell. Now, you are ready to write your database query
So far, we have learned the steps to download and install MongoDB. Now, we will move ahead with the most important topics, i.e., various queries in MongoDB and how to write and execute them.
MongoDB installation on Linux
The installation packages of 64 and 32 bits are available on the web for Linux. In order to install the tool, you need to download a suitable package.
- Download the package: Download the MongoDB packages from the following link: http://www.mongodb.org/downloads
Get to know about NoSQL in this insightful NoSQL blog!
- Unzip the folder: Unzip the downloaded folder at the location where you would like to install the tool
- Create a data directory: Create a data directory manually in the root as the data is stored in this directory only
- Run MongoDB server: Run the MongoDB server on the command prompt for which you need to execute the mongod.exe file from the bin folder inside the MongoDB folder
Concluding this tutorial, so far, we have learned how to download and install MongoDB, and then we saw how to download Robo 3T and install it for writing the MongoDB commands. I hope this tutorial has helped you clear all the doubts that arise when you start learning MongoDB so that you can choose the right career path.
We have the perfect professional MongoDB Training Course for you!