These instructions are for MongoDB 6.0 Community Edition
Prerequisites
HomeBrew
- Install brew using the official HomeBrew Installation instructions
- Go ahead if already installed
Installing MongoDB 6.0 Community Edition
-
Tap the MongoDB Homebrew Tap to download the official Homebrew formula for MongoDB and the Database Tools, by running the following command in your macOS Terminal:
brew tap mongodb/brew
-
To update Homebrew and all existing formulae:
brew update
-
To install MongoDB, run the following command:
brew install mongodb-community@6.0
Installation is done.
Running MongoDB
Start
To start MongoDB,
brew services start mongodb-community@6.0
Stop
To stop MongoDB,
brew services stop mongodb-community@6.0
Verify
To verify if MongoDB is running, use the following command:
brew services list
Mongosh
To begin using MongoDB, connect mongosh
to the running instance. From a new terminal, issue the following:
mongosh
Resources
MongoDB is installed and running.