The Official MongoDB Software Homebrew Tap
957
stars
485
commits
Ruby
primary language
Sep 8, 2026
updated

This is a custom Homebrew tap for official MongoDB software.
You can add the custom tap in a MacOS terminal session using:
brew tap mongodb/brew
Once the tap has been added, use the instructions below to install the software packages you need. You can choose to install either the latest version of the MongoDB Server (recommended), or a specific version if desired.
Install the latest available production release of the MongoDB Community Server. This includes the MongoDB Server processes mongod and mongos, the MongoDB Database Tools, and the install_compass script to separately install MongoDB Compass. Currently, this will install MongoDB Server 8.0.x.
brew install mongodb-community
Install only the latest mongosh shell for connecting to remote MongoDB instances. If you installed the MongoDB Server in the step above, the shell was included in that installation. Use this command only if you need to install the mongosh shell separately.
brew install mongosh
Install only the latest MongoDB Database Tools, a suite of command-line tools (mongoimport, mongoexport, mongodump, etc) for working with a MongoDB Server instance. If you installed the MongoDB Server in the step above, the Database Tools were included in that installation. Use this command only if you need to install the Database Tools separately.
brew install mongodb-database-tools
Alternatively, you can install a specific version of the MongoDB Server if desired.
Install the latest 8.0.x production release of MongoDB Community Server:
brew install mongodb-community@8.0
Install the latest 7.0.x production release of MongoDB Community Server:
brew install mongodb-community@7.0
In addition to installing the MongoDB server and tool binaries, the mongodb-community formula creates:
$(brew --prefix)/etc/mongod.conf$(brew --prefix)/var/log/mongodb$(brew --prefix)/var/mongodbThe default value for brew --prefix depends on your CPU architecture:
/usr/local/opt/homebrewmongod as a serviceTo have launchd start mongod immediately and also restart at login, use:
brew services start mongodb-community
If you manage mongod as a service it will use the default paths listed above. To stop the server instance use:
brew services stop mongodb-community
mongod manuallyIf you don't want or need a background MongoDB service you can run:
mongod --config /usr/local/etc/mongod.conf
Note: if you do not include the --config option with a path to a configuration file, the MongoDB server does not have a default configuration file or log directory path and will use a data directory path of /data/db.
To shutdown mongod started manually, use the admin database and run db.shutdownServer():
mongosh admin --eval "db.shutdownServer()"
If you need to uninstall the MongoDB Server, use:
brew uninstall mongodb-community
Note that this does not uninstall the bundled Database Tools. To uninstall the Database Tools, additionally run the folowing:
brew uninstall mongodb-database-tools
For more information, please reference the following documentation:
This tap was created using the Homebrew documentation on How to Create and Maintain a tap.
You can find additional information in the Homebrew project README.
If you're having issues with MongoDB please check out our community support resources.
If you've found a bug in MongoDB please open a JIRA ticket in the SERVER project.
If you are a mongodb employee and are trying to update this tap please see internal documentation.
(top 30 of 58)
Ruby
100.0%
The Official MongoDB Software Homebrew Tap
957
stars
485
commits
Ruby
primary language
Sep 8, 2026
updated

This is a custom Homebrew tap for official MongoDB software.
You can add the custom tap in a MacOS terminal session using:
brew tap mongodb/brew
Once the tap has been added, use the instructions below to install the software packages you need. You can choose to install either the latest version of the MongoDB Server (recommended), or a specific version if desired.
Install the latest available production release of the MongoDB Community Server. This includes the MongoDB Server processes mongod and mongos, the MongoDB Database Tools, and the install_compass script to separately install MongoDB Compass. Currently, this will install MongoDB Server 8.0.x.
brew install mongodb-community
Install only the latest mongosh shell for connecting to remote MongoDB instances. If you installed the MongoDB Server in the step above, the shell was included in that installation. Use this command only if you need to install the mongosh shell separately.
brew install mongosh
Install only the latest MongoDB Database Tools, a suite of command-line tools (mongoimport, mongoexport, mongodump, etc) for working with a MongoDB Server instance. If you installed the MongoDB Server in the step above, the Database Tools were included in that installation. Use this command only if you need to install the Database Tools separately.
brew install mongodb-database-tools
Alternatively, you can install a specific version of the MongoDB Server if desired.
Install the latest 8.0.x production release of MongoDB Community Server:
brew install mongodb-community@8.0
Install the latest 7.0.x production release of MongoDB Community Server:
brew install mongodb-community@7.0
In addition to installing the MongoDB server and tool binaries, the mongodb-community formula creates:
$(brew --prefix)/etc/mongod.conf$(brew --prefix)/var/log/mongodb$(brew --prefix)/var/mongodbThe default value for brew --prefix depends on your CPU architecture:
/usr/local/opt/homebrewmongod as a serviceTo have launchd start mongod immediately and also restart at login, use:
brew services start mongodb-community
If you manage mongod as a service it will use the default paths listed above. To stop the server instance use:
brew services stop mongodb-community
mongod manuallyIf you don't want or need a background MongoDB service you can run:
mongod --config /usr/local/etc/mongod.conf
Note: if you do not include the --config option with a path to a configuration file, the MongoDB server does not have a default configuration file or log directory path and will use a data directory path of /data/db.
To shutdown mongod started manually, use the admin database and run db.shutdownServer():
mongosh admin --eval "db.shutdownServer()"
If you need to uninstall the MongoDB Server, use:
brew uninstall mongodb-community
Note that this does not uninstall the bundled Database Tools. To uninstall the Database Tools, additionally run the folowing:
brew uninstall mongodb-database-tools
For more information, please reference the following documentation:
This tap was created using the Homebrew documentation on How to Create and Maintain a tap.
You can find additional information in the Homebrew project README.
If you're having issues with MongoDB please check out our community support resources.
If you've found a bug in MongoDB please open a JIRA ticket in the SERVER project.
If you are a mongodb employee and are trying to update this tap please see internal documentation.
(top 30 of 58)
Ruby
100.0%