π MongoDB macOS Installation
Complete step-by-step guide to install MongoDB Server on macOS - Intel and Apple Silicon (M1/M2/M3)
Installation Overview
Choose your installation method
This guide covers two methods to install MongoDB Community Edition on macOS: Homebrew (recommended, easiest) and Manual Installation (more control). Both methods work on Intel Macs and Apple Silicon (M1/M2/M3).
System Requirements
What you need
- macOS Version: 10.14 (Mojave) or later
- Chip Support: Intel x86_64 or Apple Silicon (M1/M2/M3)
- RAM: Minimum 4 GB (8 GB+ recommended)
- Disk Space: 5 GB free space minimum
- Xcode Command Line Tools: Required for Homebrew
Click the Apple menu β About This Mac
- Intel Mac: Shows "Processor: Intel Core i5/i7/i9"
- Apple Silicon: Shows "Chip: Apple M1/M2/M3"
Method 1: Homebrew Installation
Recommended - Easiest method
- One-command installation
- Automatic dependency management
- Easy updates with
brew upgrade - Works perfectly on Intel and Apple Silicon
- Widely used and community-supported
If you don't have Homebrew installed, install it first:
Check if Homebrew is installed:
Add the MongoDB Homebrew repository (tap):
Install the latest MongoDB Community Edition:
/opt/homebrewOn Intel Macs, Homebrew installs to
/usr/local
Start MongoDB as a macOS service:
Method 2: Manual Installation
For advanced users
This method gives you more control but requires manual configuration. If you're new to MongoDB, we recommend the Homebrew method above.
Visit the MongoDB Download Center and download the appropriate version:
Choose your chip type:
- macOS ARM64 for Apple Silicon (M1/M2/M3)
- macOS x64 for Intel Macs
mongodb-macos-arm64-7.0.5.tgz or mongodb-macos-x86_64-7.0.5.tgz
Extract the downloaded tarball and move it to a permanent location:
Add MongoDB binaries to your system PATH:
MongoDB needs directories for data storage and logs:
whoami in Terminal to see your current username.
Start MongoDB manually with custom paths:
--dbpath: Where to store database files--logpath: Where to write logs--fork: Run as background process
Verify Installation
Test MongoDB is working
Configuration
Important file locations
Edit the configuration file to customize MongoDB settings:
Troubleshooting
Common macOS issues
Check if port is in use:
Check permissions:
View logs:
If mongod or mongosh not found:
- Verify installation:
brew list | grep mongodb - Reinstall:
brew reinstall mongodb-community - Check PATH:
echo $PATH
On M1/M2/M3 Macs, if you get architecture errors:
- Make sure you're using the ARM64 version, not x86_64
- Use native ARM Homebrew (
/opt/homebrew) - Reinstall:
brew uninstall mongodb-community && brew install mongodb-community
Congratulations! MongoDB is now running on your Mac. Here's what to do next:
- Install MongoDB Compass: Get the GUI tool:
brew install --cask mongodb-compass - Learn mongosh: Practice MongoDB shell commands
- Create Your First Database: Start building applications
- Set Up Authentication: Secure your MongoDB instance
- Explore Atlas: Try MongoDB's cloud offering for production