bluehost-banner
How to install MongoDB on Windows10

How to install MongoDB on Windows10

In this tutorial, we will learn how to install and set up MongoDB on a Windows10 machine step by step.

so, let's get started...

If you are using macOS then click here.

How to install MongoDB on Windows10 step by step:

1. Download the MongoDB MSI Installer Package

Go to the download page at https://www.mongodb.com/try/download/community.

Download-Mongodb
Download-Mongodb

Choose your OS and your desired MongoDB version and Click Download.

2. Install MongoDB with the Installation Wizard

Now navigate to your downloads folder and double click on the .msi package you just downloaded, it will launch the installation wizard.

Mongo-select-as-service
Mongo-select-as-service

Make sure to select 'Install MongoD as service' while installing.

 3. Create the Data Folders to Store our Databases

Navigate to the C Drive on your computer using Explorer and create a new directory data/db here.

4. Update Environment Varialbe

Open "Edit the system environment variable -> Advanced -> Environment Variables"

Environment-Variables-Setup
Environment-Variables-Setup

Click on Path -> Edit

Edit-Path
Edit-Path

Copy the path of installed MongoDB Server("C:\Program Files\MongoDB\Server\6.0\bin").

Click on New -> paste the installed MongoDB Server path. -> Click on "OK".

Add-Environment-Varaible
Add-Environment-Varaible

Click OK and close the "Edit System Environment Variable" screen. We have done the path setup. 

5. Verify That Setup was Successful

Open the command prompt and type "mongod --version". You should get output like below:

db version v6.0.0
Build Info: {
    "version": "6.0.0",
    "gitVersion": "e61bf27c2f6a83fed36e5a13c008a32d563babe2",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "windows",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}

We can see the MongoDB version is "6.0.0" and other information.

This means that you have successfully installed and set up MongoDB on your local system!

Subscribe to our Newsletter

Stay up to date! Get all the latest posts delivered straight to your inbox.

If You Appreciate What We Do Here On TutsCoder, You Should Consider:

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Leave a Comment