MongoDB Installation on Windows: If you’re a developer looking to install MongoDB on Windows without using the MSI installer, you’re in the right place. This tutorial guides you through installing MongoDB using the ZIP archive, setting up a MongoDB database, and creating a user with a username and password. Ideal for beginners and professionals who want more control over their MongoDB setup!

Table of Contents
Why Use the ZIP File Instead of the Installer?
Using the ZIP file lets you:
- Install MongoDB without admin privileges
- Portably run MongoDB from any folder
- Configure MongoDB manually (great for learning!)
Step 1: Download the MongoDB ZIP File for Windows
- Visit the official MongoDB download page:
👉 https://www.mongodb.com/try/download/community - Select:
- Version: Choose the latest stable version.
- Platform: Windows
- Package: ZIP
- Click Download.

Step 2: Extract the ZIP File
- Extract the ZIP file to your desired directory.
For example:C:\Mongodb\mongodb-win32-x86_64-windows-8.0.9
- You’ll find a folder like:
C:\Mongodb\mongodb-win32-x86_64-windows-8.0.9\bin

Step 3: Create Data and Log Directories
MongoDB needs a folder to store database files.
Open Command Prompt and run the following command to create the required directories:
mkdir C:\Mongodb\database
mkdir C:\Mongodb\log
Once you execute the above Command, you can see the necessary folders have been created under the C:\Mongodb
folder

Step 4: Create a Configuration File (Optional but Recommended)
Create a file named mongod.cfg
in C:\Mongodb\mongodb-win32-x86_64-windows-8.0.9
With the following content:
systemLog:
destination: file
path: C:\Mongodb\log\mongod.log
logAppend: true
storage:
dbPath: C:\Mongodb\database
net:
bindIp: 127.0.0.1
port: 27017
security:
authorization: enabled
Step 5: Start the MongoDB Server
Open Command Prompt and navigate to the MongoDB bin folder:
cd C:\Mongodb\mongodb-win32-x86_64-windows-8.0.9\bin
mongod --config "C:\Mongodb\mongodb-win32-x86_64-windows-8.0.9\mongod.cfg"

Now, leave this window open to keep the MongoDB server running.
Step 6: Download the MongoDB Shell ZIP File
- Visit the official MongoDB Shell download page:
👉 https://www.mongodb.com/try/download/shell - Select:
- Version: Choose the latest version.
- Platform: Windows
- Package: ZIP
- Click Download.

Step 7: Extract the MongoDB Shell ZIP File
- Extract the ZIP file to your desired directory.
For example:C:\Mongodb\mongosh-2.5.1-win32-x64
- You’ll find a folder like the image below:

Step 8: Open a New Command Prompt and Start the Mongo Shell
Open another Command Prompt and run the following command:
cd C:\Mongodb\mongosh-2.5.1-win32-x64\bin
mongosh

You’re now inside the MongoDB shell.
Step 9: Create a MongoDB Database, Username, and Password
Switch to a new database (eg: test_db
), run the following command:
use test_db
Create a new database using the following command:
db.sample.insertOne({"name":"test_db"})
To see the created database, run the following command:
show dbs
Now, let’s create a new user (test_user
) with a security password (test_user
):
db.createUser({user: "test_user",pwd: "test_user",roles: [ { role: "readWrite", db: "test_db" }]})

Step 10: Test Login with Authentication
Exit the shell and Reconnect using the created credentials:
exit
mongosh test_db -u test_user -p test_user

If login is successful, you’re ready to manage your secured MongoDB instance!
Optional: Add MongoDB to System PATH
To run MongoDB commands from any terminal:
- Search “Environment Variables” in Windows.
- Edit System Variables → Find
Path
. - Add:
C:\Mongodb\mongodb-win32-x86_64-windows-8.0.9\bin
- Click OK.


Now you can run mongod
from anywhere.
Conclusion
You’ve successfully installed MongoDB on Windows using the ZIP file, created a database, and added a user with a username and password. This method gives you greater control and understanding of how MongoDB works under the hood.
You may want to see: MongoDB MCQs Multiple-Choice Questions and Answers