Comprehensive Guide to Installing and Configuring NoSQL Databases (MongoDB)

Mamta Yadav
4 min readMar 25, 2024

--

Introduction:
In today’s data-driven world, the need for efficient management of diverse data types such as images, voice recordings, and unstructured data has become paramount. NoSQL databases offer a robust solution for handling such data, providing flexibility, scalability, and performance. In this guide, we will walk you through the steps for downloading, installing, and setting up a NoSQL database, specifically focusing on MongoDB, one of the leading NoSQL databases.

Step 1: Downloading and Installation of NoSQL (MongoDB)

To begin, download MongoDB from the official website. Follow these steps:

1. Navigate to the MongoDB download page: [MongoDB Download Page](https://www.mongodb.com/try/download/community)
2. Choose the appropriate version and platform for your system.
3. Select the desired package and click “Download.”

Step 2: Installation Process:

  1. Double click on the downloaded file to initiate the setup process.
  2. Follow the on-screen instructions, agreeing to the license agreement, and click “Next.”
  3. Choose “Complete” setup type.
  4. Select the radio button “Run service as Network Service user”.
  5. Optionally, install MongoDB Compass by checking the checkbox and click “Next.”
  6. Click “Install” and then “Finish” to complete the installation.
In Progress

Step 3: Environment Setup Adding MongoDB Bin Directory to System Path (Windows)

  1. Open the Start menu and search for “environment variables.”
  2. Click “Edit the system environment variables.”
  3. In the System Properties window, click “Environment Variables.”
  4. Locate the “Path” variable under “System variables” and “User variables” and click “Edit.”
  5. Add the path to the MongoDB bin directory (e.g., “C:\Program Files\MongoDB\Server{version}\bin”).
  6. Click “OK” to save the changes.

Step 4: Starting MongoDB Server

  1. Open Command Prompt.
  2. Navigate to the MongoDB installation directory, typically located at “C:\Program Files\MongoDB\Server{version}\bin”.
  3. Run the command mongod to start the server. (Note: If you encounter an error regarding the absence of "C:/data/db/", create these directories manually and rerun the mongod command.)

mongod:

Now, this time the MongoDB server(i.e., mongod) will run successfully.

Step 5: Verifying MongoDB Installation To ensure MongoDB is installed correctly, open a new command prompt window and run:

mongod --version

This command should display the installed MongoDB version.

Step 6: Install MongoDB Shell (mongosh)

  1. Download MongoDB Shell: Visit the official MongoDB website and download the appropriate version of MongoDB Shell for your system.
  2. Extract ZIP File: After downloading, extract the contents of the ZIP file containing MongoDB Shell.
  3. Move to Installation Directory: Navigate to the extracted MongoDB Shell folder and move it to the MongoDB installation directory located in the C drive (e.g., “C:\Program Files\MongoDB\Server{version}”).
  4. Configure Environment Variables: Add the path to the MongoDB Shell folder to the system environment variables by editing the “Path” variable under both “System variables” and “User variables.”

Step 7: Connect to the MongoDB Server with MongoDB Shell

  1. Open a new command prompt window.
  2. Run the following command to connect to the MongoDB server using MongoDB shell:
mongosh

The MongoDB shell should start and automatically connect to the running MongoDB server. (Note: Do not close the command prompt window running the MongoDB server (mongod) to maintain the connection between the server and the shell.)

For further assistance or troubleshooting, refer to resources like Stack Overflow.

Conclusion:
NoSQL databases like MongoDB offer a powerful solution for managing diverse data types effectively. By following the steps outlined in this guide, you can set up MongoDB seamlessly and unlock its capabilities for your data management needs. Embrace the versatility and scalability of NoSQL databases to drive innovation and insights from your data. (Note: Make sure to replace {version} placeholders with the actual version numbers in the installation path.)

--

--

Mamta Yadav
Mamta Yadav

Written by Mamta Yadav

Information geek, TecH enthusiasm. ||||| Storyteller from my preliterate days. I write them down✍️

Responses (1)