How to Install MongoDB in Windows 11: A Step-by-Step Guide

If you’re diving into backend development, data engineering, or modern web apps, you’ve likely heard of MongoDB — one of the most popular NoSQL databases in the world.

MongoDB stores data in flexible JSON-like documents, making it perfect for developers who work with unstructured or dynamic datasets.

This guide will walk you through how to install MongoDB in Windows 11, from downloading to running your first MongoDB server — step-by-step, even if you’re a beginner.


🧩 What Is MongoDB?

MongoDB is an open-source NoSQL database developed by MongoDB Inc. Unlike traditional relational databases (like MySQL or SQL Server), MongoDB:

  • Stores data as documents (BSON format) instead of tables.

  • Supports dynamic schemas.

  • Scales easily with horizontal sharding.

  • Works perfectly with Node.js, Python, Java, and more.

🧠 Key Advantages:

  • Schema-less (you can store any structure)

  • High performance and scalability

  • Easy integration with modern apps

  • Rich query and indexing features


⚙️ System Requirements for MongoDB on Windows 11

Before installing, make sure your PC meets the basic requirements.

Requirement Minimum Recommended
Windows Version Windows 10/11 (64-bit) Windows 11 Pro/Enterprise
RAM 4 GB 8 GB or more
Disk Space 1 GB 10 GB+ for databases
Privileges Administrator rights Required for installation

💡 Note: MongoDB doesn’t support 32-bit Windows.


🪜 Step 1: Download MongoDB for Windows 11

  1. Open your browser and visit the official MongoDB download page:
    👉 https://www.mongodb.com/try/download/community

  2. Under Version, select the latest stable release.

  3. Choose Windows as the operating system.

  4. Set the Package to MSI (Windows Installer).

  5. Click Download.

This will download a .msi file (e.g., mongodb-windows-x86_64-7.0.2-signed.msi).


🪜 Step 2: Run the MongoDB Installer (MSI)

  1. Locate the downloaded .msi file in your Downloads folder.

  2. Double-click to run the installer.

  3. The MongoDB Setup Wizard will open. Click Next.

  4. Accept the License Agreement and click Next.

You’ll then have two setup options:

  • Complete → Installs MongoDB with all features.

  • Custom → Lets you choose where MongoDB is installed.

Select Complete (recommended).


🪜 Step 3: Choose MongoDB Service Configuration

In the setup wizard, you’ll see the Service Configuration screen.

✅ Options:

  • Run Service as Network Service user (Recommended)

  • Service Name: MongoDB

  • Data Directory: C:\Program Files\MongoDB\Server\<version>\data

  • Log Directory: C:\Program Files\MongoDB\Server\<version>\log

Click Next.

💡 Tip: You can change these directories later if you want to store your database on another drive.


🪜 Step 4: Install MongoDB as a Windows Service

Check the option:

✅ “Install MongoDB as a Service.”

This allows MongoDB to start automatically when your computer boots.

Click Next → Install and wait for the setup to complete.

Once done, click Finish to exit the installer.


🪜 Step 5: Verify MongoDB Installation

To verify MongoDB installed correctly:

  1. Press Windows + S, type Services, and open it.

  2. Find MongoDB in the list.

  3. Ensure the Status says “Running.”

  4. If not, right-click → select Start.

Alternatively, you can check using Command Prompt:

net start MongoDB

If MongoDB is already running, you’ll see:

“The requested service has already been started.”


🪜 Step 6: Set Up MongoDB Data and Log Directories (Manual Method)

If you installed MongoDB without the “Run as a Service” option, you’ll need to manually create folders.

🧱 Steps:

  1. Open File Explorer.

  2. Create folders at:

    C:\data\db
    C:\data\log
  3. MongoDB uses these folders to store databases and logs.


🪜 Step 7: Add MongoDB to Windows PATH (Environment Variables)

Adding MongoDB to your system’s PATH lets you use it from any terminal.

🪜 Steps:

  1. Press Windows + S, search for Environment Variables, and open it.

  2. Click Environment Variables.

  3. Under System variables, find and select Path, then click Edit.

  4. Click New and paste the MongoDB bin folder path:

    C:\Program Files\MongoDB\Server\<version>\bin
  5. Click OK → OK → Apply.

💡 Now you can run mongod or mongosh commands from any folder.


🪜 Step 8: Start MongoDB Server Manually (If Needed)

If MongoDB isn’t running as a service, start it manually:

  1. Open Command Prompt (Run as Administrator).

  2. Type:

    mongod
  3. You should see a message like:

    “Waiting for connections on port 27017”

That means MongoDB server is running successfully!


🪜 Step 9: Connect to MongoDB Using mongosh

MongoDB 6.0+ comes with a new shell called mongosh.

  1. Open Command Prompt.

  2. Type:

    mongosh
  3. You should see:

    test>

    — which means you’re inside the MongoDB shell.

You can now start running commands like:

show dbs

or

db.version()

🪜 Step 10: Create Your First Database

Try creating a database called “mydb”:

use mydb

Insert a document:

db.users.insertOne({ name: "John Doe", age: 30, city: "New York" })

View the data:

db.users.find()

If you see your inserted document, MongoDB is working perfectly!


🧩 Step 11: Configure MongoDB to Run on Startup

If you didn’t install MongoDB as a service earlier, you can enable it manually.

🪜 Steps:

  1. Open Command Prompt (Admin).

  2. Run:

    "C:\Program Files\MongoDB\Server\<version>\bin\mongod.exe" --config "C:\Program Files\MongoDB\Server\<version>\bin\mongod.cfg" --install
  3. Then start the service:

    net start MongoDB

MongoDB will now automatically start every time Windows boots.


🧩 Step 12: Connect MongoDB with Compass (GUI Tool)

MongoDB Compass is a visual tool for managing your databases easily.

🪜 Steps:

  1. Go to MongoDB Compass Download Page.

  2. Download and install it.

  3. Open Compass → click Connect → use the default connection string:

    mongodb://localhost:27017
  4. You can now explore your databases visually.

💡 Perfect for developers who prefer GUI instead of command-line.


🧩 Step 13: Common MongoDB Commands

Command Description
show dbs List all databases
use mydb Switch to (or create) a database
db.createCollection("users") Create a new collection
db.users.insertOne({...}) Insert one document
db.users.find() View all documents
db.dropDatabase() Delete current database

🧩 Step 14: Troubleshooting Installation Issues

Problem Cause Solution
mongod not recognized PATH not set Add MongoDB bin folder to Environment Variables
Service not starting Permissions issue Run Command Prompt as Administrator
“Data directory not found” Missing folders Create C:\data\db manually
Compass can’t connect Wrong port or service stopped Verify MongoDB service is running

🧩 Step 15: Update or Uninstall MongoDB

🪜 To Update:

  1. Stop MongoDB service:

    net stop MongoDB
  2. Download the latest MSI installer.

  3. Run it → choose Upgrade.

🪜 To Uninstall:

  1. Go to Settings → Apps → Installed apps → MongoDB.

  2. Click Uninstall.

  3. Delete leftover data folders:

    C:\Program Files\MongoDB
    C:\data

🧮 Summary Table: MongoDB Installation Methods

Method Description Recommended For
MSI Installer (GUI) Simple, user-friendly wizard Beginners
ZIP Archive Manual setup Advanced users
Service Configuration Automatic startup Developers
Compass GUI Tool Visual database interface Non-technical users

🎯 Key Takeaways

  • MongoDB is a powerful NoSQL database for flexible data storage.

  • Use the MSI installer for easy setup on Windows 11.

  • Add MongoDB to PATH for convenient terminal access.

  • Start MongoDB via Service or Command Prompt.

  • Verify installation using mongosh and test basic commands.

💬 With MongoDB installed, you’re ready to build modern, scalable, and data-driven applications!


🧠 Conclusion

You’ve now successfully learned how to install MongoDB in Windows 11 step by step.

From downloading and installing to configuring and verifying, you’ve covered everything you need to get started.

Whether you’re developing with Node.js, Python, or Java, MongoDB integrates seamlessly and scales effortlessly — making it a top choice for developers worldwide.

Go ahead — fire up mongosh, create your first database, and start building something amazing!


❓ FAQs: How to Install MongoDB in Windows 11

1. Is MongoDB free to use on Windows 11?

Yes, MongoDB Community Edition is completely free and open-source.


2. What is the default MongoDB port number?

MongoDB runs on port 27017 by default.


3. How do I stop the MongoDB service?

Open Command Prompt (Admin) and type:

net stop MongoDB

4. Can I install multiple versions of MongoDB?

Yes — you can install multiple versions by using different directories and data paths.


5. How do I uninstall MongoDB completely?

Go to Settings → Apps → MongoDB → Uninstall, then manually delete:

C:\data
C:\Program Files\MongoDB

6. What is MongoDB Compass?

It’s the official GUI tool from MongoDB for managing databases visually.


7. How do I know MongoDB is running?

Run this command in Command Prompt:

net start MongoDB

or check Services → MongoDB → Status: Running.

Scroll to Top