How to Install MongoDB with mongosh on Windows (Manually)

Hello Devs! Here's a clean step-by-step guide you can use to install and run MongoDB with mongosh on Windows:
Step 1: Download MongoDB Server
Select:
Version: 8.0 (latest stable)
OS: Windows
Package:
.msi (Installer)
Click Download and run the installer.
Step 2: Install MongoDB Server
Run the
.msifile.During installation:
Select Complete setup.
✔️ Enable “Install MongoDB as a Service” (recommended).
✔️ Check “Install MongoDB Compass” if you need GUI (for beginners).
Step 3: Create Data Directory
MongoDB stores database files in C:\data\db by default.
Open PowerShell and run:
mkdir C:\data\db
Step 4: Start MongoDB Server
Open a new terminal and run:
mongodYou’ll see logs like
Waiting for connections at 127.0.0.1:27017
Step 5: Download mongosh (Mongo Shell)
MongoDB no longer includes mongosh by default.
Select:
Version:
2.5.xor latestOS:
Windows 64-bitPackage:
.zip archive
Download and extract the ZIP file.
Step 6: Move mongosh to Program Files
Create a folder:
C:\Program Files\MongoDB\mongoshMove all extracted files (from
mongosh-2.5.3-win32-x64) into this folder.
Step 7: Add MongoDB to System PATH
So you can use mongod and mongosh from anywhere.
Press
Win + S, search for Environment Variables, and open it.Under System Variables, find
Path→ click Edit.Click New, and add these:
C:\Program Files\MongoDB\Server\8.0\bin C:\Program Files\MongoDB\mongosh\binClick OK → OK → OK to close all dialogs.
Step 8: Verify Installation
Open a new PowerShell or CMD window and run:
mongod --version
mongosh --version
Both should return version info.
Step 9: Connect to MongoDB
Run:
mongoshYou’ll connect to
mongodb://127.0.0.1:27017and enter the Mongo shell prompt:test>
You're now ready to use MongoDB!
So! this was a step-by-step guide to installing and running MongoDB with mongosh on Windows. It involves downloading the MongoDB server and mongosh, installing them, setting up a data directory, and adding executables to the system PATH. Finally, you verify the installation and connect to MongoDB using mongosh.



