Tuesday, December 16, 2025

MongoDB Installation on windows.

 

Requirement: Install MongoDB on Windows


1. Download MongoDB Community Server

  • Click here to download MongoDB Community Server
  • Choose Windows (x64)
  • Download the MSI installer

2. Install MongoDB Community Server

  • Double-click the downloaded .msi file
  • Select Complete Installation
  • Keep all default options selected
  • Allow MongoDB to install as a Windows Service
  • Click Next and complete the installation

Note: Installation may take a few minutes.


3. Create MongoDB Connection (MongoDB Compass)

  • Open MongoDB Compass (installed with Community Server)
  • Click “Add New Connection”
  • Use the default connection string:

    mongodb://localhost:27017
  • Click Connect

4. Download MongoDB Shell (mongosh)

  • Click here to download MongoDB Shell (mongosh)
  • Download the Windows version

5. Install MongoDB Shell (mongosh)

  • Run the mongosh installer
  • Click Next
  • When prompted for the installation path:

    • Create a folder in C Drive
    • Folder name: Mongosh
    • Example:

      C:\Mongosh
  • Complete the installation

6. Set Environment Variables

A. Environment Variable for MongoDB Community Server

  • Copy the bin folder path:

    C:\Program Files\MongoDB\Server\8.2\bin
  • Search for Environment Variables
  • Edit System Variables → Path
  • Add the copied bin path
  • Click OK

B. Environment Variable for mongosh (Shell)

  1. Open System Properties

    • Press Win + R
    • Type sysdm.cpl and press Enter
  2. Go to Advanced → Environment Variables
  3. Under System Variables, select Path → Edit
  4. Click New and add:

    C:\Mongosh\bin
  5. Click OK on all windows

7. Test MongoDB Installation

  • Open Command Prompt
  • Run:

    mongosh

✅ Connection should be successful.


8. Check Database Using MongoDB Shell

  • In the mongosh terminal, run:

    show dbs
  • Databases will be displayed successfully.

🎉 MongoDB Installation Completed Successfully

No comments:

Post a Comment

If you have any problem please let me know.