MongoDB Installation & Setup Guide (Windows & Mac, 2025)

MongoDB Installation

Introduction

This guide provides a step-by-step manual for MongoDB installation and setup on Windows 10, Windows 11, and Mac. Whether you're a developer or a beginner, follow these instructions to get MongoDB running on your system in 2025.

1️⃣ Prerequisites

  • 64-bit Windows 10/11 or macOS (latest version recommended)
  • At least 2GB RAM
  • Internet connection for downloading MongoDB installer
  • Administrator privileges on your system

2️⃣ MongoDB Installation on Windows 10/11

MongoDB Windows Installer
  1. Go to the MongoDB Community Download page.
  2. Choose Windows as the OS and download the MSI installer.
    (Keywords: MongoDB install download, download MongoDB installer)
  3. Double-click the downloaded .msi file to launch the installer.
  4. Follow the installation wizard:
    • Accept the license agreement
    • Choose Complete setup
    • Optionally install MongoDB Compass (GUI)
  5. Click Install and wait for the process to finish.
    (Keywords: MongoDB installation steps windows 10, MongoDB install step by)
  6. After installation, add MongoDB to your system PATH:
    • Open System Properties → Environment Variables
    • Edit the Path variable and add the MongoDB bin directory (e.g., C:\Program Files\MongoDB\Server\6.0\bin)
  7. To start MongoDB, open Command Prompt and run:
    mongod
  8. To connect, open a new Command Prompt and run:
    mongo

Tip: For production, run MongoDB as a Windows service (select this option during installation).

3️⃣ MongoDB Installation on Mac

MongoDB Mac Installation
  1. Open Terminal.
  2. Install Homebrew if not already installed:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. Tap the MongoDB Homebrew tap:
    brew tap mongodb/brew
  4. Install MongoDB Community Edition:
    brew install mongodb-community@6.0
  5. Start MongoDB as a service:
    brew services start mongodb-community@6.0
  6. To connect, run:
    mongo

Tip: You can stop MongoDB with brew services stop mongodb-community@6.0.

4️⃣ Post-Installation Setup

  • Verify installation by running mongo --version and mongod --version
  • Default data directory is C:\data\db (Windows) or /data/db (Mac). Create this directory if it doesn't exist.
  • For GUI, use MongoDB Compass (optional, installed during setup)

FAQ

On Windows, use the Control Panel → Programs → Uninstall. On Mac, use brew uninstall mongodb-community@6.0.

On Windows: C:\Program Files\MongoDB\Server\6.0\
On Mac: /usr/local/Cellar/mongodb-community/

Use the --dbpath option when starting mongod, e.g., mongod --dbpath C:\my\data\dir

Conclusion

MongoDB is easy to install and set up on both Windows and Mac. Follow the steps above to get started with your NoSQL database in 2025. For more advanced configuration, see the official MongoDB documentation.