1. First of all, you need to download the MongoDB Community Server using this URL: https://www.mongodb.com/try/download/community. Click on the version you need according to your Windows version (64bit or 32bit), and then hit the “Download” button.
1. After the .msi file is downloaded, double click it to start the setup process. Click “Next” on the first screen and then accept the license agreement and click “Next” again.
1. Choose “Complete” for the Setup Type for an easier configuration, and then click “Next”.
1. In the following screen, check the “Install MongoDB as a Service” option which is generally easier for beginners. You can choose to run the service as Network Service user (lower privileges) or a local or domain user (higher privileges).
1. In the next screen, you can choose to install MongoDB Compass, which is a graphical interface for MongoDB databases. If you’re not sure, it is recommended to install it. Click “Next”.
1. Finally, click the “Install” button to start the MongoDB installation. When it’s done, click on the “Finish” button.
1. Once MongoDB is installed, the MongoDB service starts running in the background, indicating that MongoDB is ready to use.
1. For interacting with MongoDB, you’d use MongoDB shell. Open Command Prompt, and use the following command to navigate to the bin folder of the MongoDB installation directory:
cd C:\Program Files\MongoDB\Server\4.0\bin Note: Change the version number according to your installation.1. Now you can interact with MongoDB using the mongo.exe command for MongoDB shell.
1. If you want your MongoDB to be accessible from anywhere on your system, you need to set MongoDB’s bin folder path in the system environment variables. Search for “Environment Variables” on your windows search, click on “Edit System Environment Variables”. A System properties popup opens, where you need to click on “Environment variables”. Under system variables, find ‘Path’ and click on Edit. In the Edit environment variable popup, click on New and paste your MongoDB’s bin folder path (C:\Program Files\MongoDB\Server\4.0\bin)
1. For easier use of MongoDB, you can also install MongoDB Compass which is a GUI for MongoDB.
Note: You need to allow the MongoDB network access through your firewall by creating a new inbound rule for port 27017 (default MongoDB port).