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
-
Open your browser and visit the official MongoDB download page:
👉 https://www.mongodb.com/try/download/community -
Under Version, select the latest stable release.
-
Choose Windows as the operating system.
-
Set the Package to MSI (Windows Installer).
-
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)
-
Locate the downloaded
.msifile in your Downloads folder. -
Double-click to run the installer.
-
The MongoDB Setup Wizard will open. Click Next.
-
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:
-
Press Windows + S, type Services, and open it.
-
Find MongoDB in the list.
-
Ensure the Status says “Running.”
-
If not, right-click → select Start.
Alternatively, you can check using Command Prompt:
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:
-
Open File Explorer.
-
Create folders at:
-
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:
-
Press Windows + S, search for Environment Variables, and open it.
-
Click Environment Variables.
-
Under System variables, find and select Path, then click Edit.
-
Click New and paste the MongoDB bin folder path:
-
Click OK → OK → Apply.
💡 Now you can run
mongodormongoshcommands from any folder.
🪜 Step 8: Start MongoDB Server Manually (If Needed)
If MongoDB isn’t running as a service, start it manually:
-
Open Command Prompt (Run as Administrator).
-
Type:
-
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.
-
Open Command Prompt.
-
Type:
-
You should see:
— which means you’re inside the MongoDB shell.
You can now start running commands like:
or
🪜 Step 10: Create Your First Database
Try creating a database called “mydb”:
Insert a document:
View the data:
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:
-
Open Command Prompt (Admin).
-
Run:
-
Then start the service:
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:
-
Download and install it.
-
Open Compass → click Connect → use the default connection string:
-
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:
-
Stop MongoDB service:
-
Download the latest MSI installer.
-
Run it → choose Upgrade.
🪜 To Uninstall:
-
Go to Settings → Apps → Installed apps → MongoDB.
-
Click Uninstall.
-
Delete leftover data folders:
🧮 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
mongoshand 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:
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:
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:
or check Services → MongoDB → Status: Running.
