MongoDB Installation
This chapter details how to install and configure MongoDB on different operating systems, including both Community and Enterprise editions.
System Requirements
Minimum Requirements
- Operating System: Windows 10/11, macOS 10.14+, Linux (Ubuntu 18.04+, CentOS 7+)
- Memory: At least 4GB RAM (8GB+ recommended)
- Disk Space: At least 10GB available space
- Processor: 64-bit processor
Windows Installation
Method 1: Using MSI Installer
-
Download Installer
- Visit MongoDB Download Center
- Select Windows version (MSI format)
- Download the latest stable version
-
Run Installer
-
Configure Environment Variables
Method 2: Using Chocolatey
macOS Installation
Method 1: Using Homebrew (Recommended)
Method 2: Manual Installation
Linux Installation (Ubuntu/Debian)
Linux Installation (CentOS/RHEL)
Add the following content:
Docker Installation
Verify Installation
Check Version
Start MongoDB Shell
Basic Command Test
Configuration File
Configuration File Locations
- Windows:
C:\Program Files\MongoDB\Server\7.0\bin\mongod.cfg - Linux/macOS:
/etc/mongod.conf
Common Configuration Options
Common Issues
1. Port Already in Use
2. Permission Issues (Linux)
3. Connection Refused
Installing MongoDB Compass (GUI Tool)
MongoDB Compass is the official GUI tool that supports visual querying, index management, data import/export, and more.
Download and Install
- Visit MongoDB Compass Download
- Download the installer for your system
- Follow the wizard to complete installation
Connect to Database
- Open Compass
- Enter connection string:
mongodb://localhost:27017 - Click Connect
Summary
This chapter covered multiple MongoDB installation methods:
- Windows: MSI installer or Chocolatey
- macOS: Homebrew or manual installation
- Linux: Package manager installation
- Docker: Containerized deployment
Choose the installation method suitable for your environment and complete MongoDB installation and basic configuration.
In the next chapter, we will learn about MongoDB Concepts.