Home

Awesome

<img src="https://webassets.mongodb.com/_com_assets/cms/mongodb-logo-rgb-j6w271g1xn.jpg" width="256"> <img src="https://brew.sh/assets/img/homebrew-256x256.png" height="72">

The MongoDB Homebrew Tap

This is a custom Homebrew tap for official MongoDB software.

Setup

You can add the custom tap in a MacOS terminal session using:

brew tap mongodb/brew

Installing Formulae

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.

Installing the Latest mongodb-community Server, Shell, and the Database Tools Together

Installing only the Shell or the Database Tools

Installing a Specific Version of the mongodb-community Server

Alternatively, you can install a specific version of the MongoDB Server if desired.

Default Paths for the mongodb-community Formula

In addition to installing the MongoDB server and tool binaries, the mongodb-community formula creates:

The default value for brew --prefix depends on your CPU architecture:

Starting the mongodb-community Server

Run mongod as a service

To 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

Start mongod manually

If 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()"
mongo admin --eval "db.shutdownServer()"

Uninstalling the mongodb-community Server

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

The Documentation

For more information, please reference the following documentation:

Additional Information and Problem Reporting

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 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.