top of page

Setting Up MongoDB




MongoDB is a famous open-source document-oriented NoSQL database globally designed to hold enormous amounts of data. It supports JSON-like documents, ad hoc queries, indexing, and real-time aggregation, making it popular in the database sector and allowing you to interact with data more efficiently.


With the growing popularity of MongoDB, web developers must now install and use MongoDB on their systems.


This post will walk you through downloading and installing completely MongoDB in Windows 10. You can learn how to design a web application utilizing the MongoDB database by taking CipherSchools' web application development course and landing the job of your dreams.


This comprehensive guide will walk you through the installation of MongoDB 6.0.1 Community Edition in Windows 10 and Linux environments. So let's get this party started.


An Overview of Windows OS


Windows is a graphical operating system from Microsoft. It enables users to connect to the internet, view and store files, run the software, play games, and watch videos. It was made accessible for both private and business use.


Version 1.0 was the name given to the initial release by Microsoft. It was released on November 10, 1983, for personal and business computers. Later, it was made available on other Windows versions, including the most recent one, Windows 10.


The first version of Windows geared at businesses, Windows NT 3.1, was released in 1993. Then Windows 3.5, 4/0, and Windows 2000 were released. Microsoft intended numerous editions for home and business use when it released Windows XP in 2001.


It was constructed using standard x86 hardware like Intel and AMD processors. As a result, it may function on a range of hardware, including computers made by HP, Dell, and Sony, as well as custom PCs.


Setting Up MongoDB in Windows


Step 1: Get the MongoDB MSI Installer Package.


Go here to get the most recent version of MongoDB. Make sure that MSI is the package you want to download. Otherwise, copy and paste this URL on your browser https://www.mongodb.com/try/download/community


Step 2: Use the Installation Wizard to install MongoDB.


Ensure that you are logged in as an administrator. Then, in your downloads folder, double-click the.msi package you just downloaded. The installation wizard will be launched as a result of this.


  1. Click Next to begin the installation process.

  2. Accept the license agreement and then press the Next button.

  3. Choose the Complete setup option.

  4. Choose "Run service as Network Service user" and save the data directory; we'll need it later.

  5. We won't need Mongo Compass, so uncheck it and proceed.

  6. Click Install to begin the installation process.

  7. Click Finish to finish the installation.


Step 3: Make Data Folders to Hold Our Databases


  1. Using Explorer, navigate to your computer's C Drive and create a new data folder.

  2. Create a new folder called db inside the data folder you just made.


Step 4: Create Mongo and Mongodb Alias Shortcuts


Once the installation is complete, we must configure MongoDB on the local machine.


  1. Launch Git Bash in your Hyper terminal.

  2. Use the following command to change your directory to your home directory:

cd ~

  1. Now, we'll use the following command to create a file called.bash_profile:

touch .bash_profile

  1. Use the following command to open the freshly created.bash_profile in vim:

vim .bash_profile

  1. To enter insert mode in vim, press the I key on the keyboard.

  2. Navigate to C Programme Files MongoDB Server in your Explorer.

You should now see the MongoDB version.

  1. Paste the following code into Vim, replacing the 4.0 with the version you see in Explorer.

alias mongod="/c/Program\ files/MongoDB/Server/4.0/bin/mongod.exe"

alias mongo="/c/Program\ Files/MongoDB/Server/4.0/bin/mongo.exe"

  1. To exit the insert mode, press the Escape key on your keyboard. After that, type:wq!

  2. It will save and close Vim.


Step 5: Confirm that the setup was successful.

  1. Exit the current Hyper terminal and the program.

  2. Restart Hyper.

  3. In the Hyper terminal, enter the following commands:


mongo –version


After pressing enter, you should see something like this:


This implies you've successfully installed and configured MongoDB on your local machine!

If you see something that looks like the bash mongo command is not found, follow all of the steps above, ensuring there are no mistakes and you have caught all of them. As a result, these are the quick steps for installing MongoDB on your Windows system. If you are working on a Linux machine, we will look at the methods for installing MongoDB on Linux workstations in the following section of the article.


Benefits of installing MongoDB on Windows


Installing MongoDB on Windows provides various benefits, making it a popular choice among developers and organizations. The following are some of the primary benefits of installing MongoDB on Windows:


Compatibility: MongoDB has official support for the Windows operating system, ensuring that the database runs smoothly in Windows situations. This interoperability enables developers and organizations to use MongoDB's capabilities without switching to a separate operating system.


Easy Installation: MongoDB has a simple installation process on Windows. The MongoDB Community Edition includes a Windows installer package that simplifies the installation and configuration stages, allowing users to get up and running with MongoDB quickly.


Graphical User Interface (GUI) Tools: MongoDB provides official graphical user interface (GUI) tools for Windows, such as MongoDB Compass. These tools make it easier for developers and administrators to work with MongoDB by providing a user-friendly interface for managing databases, running queries, and visualizing data.

6 views

Recent Posts

See All
bottom of page