In this article, we will see how we can download and install MongoDB in windows os.

Download the MongoDB

First, we need to download the latest version of MongoDB from here.

Install MongoDB

Once the installation is finished, open the MSI file and follow the below steps.

Click on Next to continue the installation process.

Accept terms and agreements and click on the Next button.

Click on the Complete button to install everything.

Check “Run service as Network Service user” and remember or copy the data directory path, we will use this later.

Click on Next to continue the installation process.

Click on the Install button to install complete setups and wait to complete the process. and when done, click the Finish button to complete the installation.

Set up folders for MongoDB

MongoDB needs a “data” folder inside the “C” drive. and inside the “data” folder need to create the “db” folder. so let’s create both folders.

 

Now, open command prompt from the Start menu or press Windows key + R. and go to the bin directory of MongoDB, usually below will be default path.

C:\Program Files\MongoDB\Server\4.2\bin

“4.2” version may be different base on the latest version of MongoDB.

Now type “mongod” command to start mongo demon.

Open again new command prompt from the Start menu or press Windows key + R. and go to the bin directory of MongoDB.

Now type “mongo” command to start mongo shell.

as you can see mongo shell is open now.

Now, let’s execute the below command to show default databases.

show dbs

we can see a default dbs it’s mean we have successfully installed MongoDB in our os.

hope you guys found something useful. Please give your valuable feedback/comments/questions about this article. Please let me know how you like and understand this article and how I could improve it.

Footer Logo

Subscribe

Select Categories