MongoDB Installation
Learn how to install MongoDB on Mac, Windows, and Linux with Docker.
Install on Mac
Prerequisites
Below is a list of prerequisites to install the MongoDB on macOS:
- Xcode Command Line Tools:
Use the below command to install Xcode command-line tools. Run the below command in your macOS terminal.
xcode-select --install
- Homebrew: Follow these instructions to install Homebrew.
Install MongoDB community edition
Follow the below steps to install the MongoDB community edition:
-
Tap the MongoDB Homebrew to download the official Homebrew formula for MongoDB and the Database Tools. Run the below command in your macOS terminal.
brew tap mongodb/brew
-
Install MongoDB. Run the below command in the macOS terminal.
brew install mongodb-community@5.0
This command will show downloading progress. Once that is completed, we’ll be able to check whether MongoDB is installed or not.
Type the below command in your macOS terminal to check whether MongoDB is successfully installed or not.
mongod --version
This command will return the MongoDB version installed on your system.
Run the below command in your macOS terminal to start the MongoDB Service.
brew services start mongodb-community@5.0
After running the above command you will see a message “Successfully started mongodb-community
...