DEV Community

Cover image for MongoDB Ditches Tradition, Pushes Developers to Download Software Separately.
Chidozie Zeno Ezeanekwe
Chidozie Zeno Ezeanekwe

Posted on

MongoDB Ditches Tradition, Pushes Developers to Download Software Separately.

Hey there developers! 👋🏾

If you're a fan of using MongoDB for your database needs, you may have noticed that the latest version 6 no longer comes bundled with mongo.exe But no worries, I'm here to guide you through the process of downloading and installing MongoDB and its shell, Mongosh for mongoDB to work.

First off,

head on over to the official MongoDB website,


scroll down,


and download the version of MongoDB that's right for you.

Make sure to choose the version compatible with your operating system.

Image description
Once you have the downloaded file, let's get started with the installation process:

Step 1: Install MongoDB

  1. Double-click on the downloaded file to open the installer.

  2. Follow the instructions on the screen to complete the installation process.

  3. Once the installation is complete, you'll need to run the mongod process to start the MongoDB server. To do this, open up a terminal or command prompt and navigate to the bin directory within the MongoDB installation folder.

Mine was "C:\Program Files\MongoDB\Server{version_number}\bin".
Replace "{version_number}" with the version of MongoDB you have installed. the current version as at writing was 6.0

  1. Then run the following command:
mongod.exe --dbpath "C:\data\db"
Enter fullscreen mode Exit fullscreen mode

or

mongod --dbpath "C:\data\db"
Enter fullscreen mode Exit fullscreen mode

This command will start the MongoDB server and use the directory "C:\data\db"(data directory with db directory inside) as the data directory for the server. If the directory does not exist, It will create it before running the command "mongod.exe" or "mongod".
you should see some output in the terminal indicating that it's running.

Note: Keep the Command Prompt or PowerShell window open and running

Step 2: Install Mongosh

  1. Head over to the Mongosh download page

  1. Download the zip file for your operating system.

  1. Extract the contents of the zip file to the bin directory within the MongoDB installation folder.

  2. Copy the Contents in the just zipped bin's folder and paste it in the mongoDB bin's folder.

  3. Open up a terminal or command prompt and navigate to the bin directory within the MongoDB installation folder.

To start using Mongosh, run the following command:

mongosh
Enter fullscreen mode Exit fullscreen mode

And that's it!

You should now be able to start working with your MongoDB database using the Mongosh shell.

So there you have it, a simple and straightforward guide on how to download and install MongoDB and Mongosh. Happy coding!"

Top comments (0)