MongoDB installation on Windows PC

 How to download and install MongoDB community server on Windows PC?

Step 1: Download MongoDB Community Server
Hit the below URL which is the official page of MongoDB:
https://www.mongodb.com/
Navigate to "Software" dropdown and click on "Community Server"


Select the required version and click on Download


Step 2: Install MongoDB community server

Click on the downloaded msi file and start the installation process


Once the set up wizard opens, click on Next

Accept the terms


Choose Complete if you don't need customization, and click on Next


Uncheck "Install MongoD as a service". This is done because we will be manually starting up the server. Click on Next

Uncheck "Install MongoDB Compass". Check this if you need "MongoDB Compass"
Click on "Install" and the installation process will start.



Click on Finish once the Installation process is completed.

MongoDB will be installed in the Program Files directory



Step 3: Verify MongoDB installation

Create "Data/db" directory inside C Drive
(If these directories are not created then you will see an error while connecting to the server
Error Message: "no connection could be made because the target machine actively refused it, MongoDB error, MongoDB error while connecting
")

Open Command Prompt and Change Directory to the installation folder's bin directory and run the command "mongod"


You will notice that the server has started up


Open another Command Prompt and Change Directory to the installation folder's bin directory and run the command "mongo"

You will now see that you have connected to MongoDB successfully and you will be able to create a test database by entering the command "use TestDatabase"

Youtube Video:



Cheers!

Comments