Brew install mongodb-community@4.4 Note: The installation includes:. The mongod server,. The mongos sharded cluster query router,. The mongo shell. Refer to this screenshot: Finally to run MongoDB (i.e. The mongod process) as a macOS service, issue the following: brew services start mongodb-community@4.4 screenshot. Starting in MongoDB 4.4.1, installing MongoDB via brew also installs the MongoDB Database Tools. The MongoDB Database Tools are a collection of command-line utilities for working with a MongoDB deployment, including data backup and import/export tools like mongoimport and mongodump as well as monitoring tools like mongotop. Brew services start mongodb-community@4.4 If you installed MongoDB using a TGZ or ZIP file, you will need to create your own configuration file. A basic example configuration can be found later in this document. Install MongoDB. Installing MongoDB with Homebrew is so easy, what am I even here for 😄? Brew install mongodb. Now to start mongodb just execute the following command: brew services start mongodb. See how easy brew services makes it? Mongodb now starts alongside your mac! We don’t have to create a database manually.

We know macOS users love using Homebrew, aka Brew, 'the missing package manager for macOS'. Its made life so much simpler when installing both open source and freely available applications. It's also not a centralized package system - it lets anyone create a tap to make their software available. That is why we are very happy to announce that we now have our own official MongoDB Tap which makes it simpler than ever to install the latest MongoDB.
Opening the Tap
As it’s our own Brew Tap, you need to add it to your list of taps. That’s simply a matter of adding the tap.
Now we’re ready to pour.
Pouring from the Tap
If you want to install the latest full release of MongoDB Community edition complete with tools, it is as simple as running:
There is one tool which people often want to install on its own, and that’s the MongoDB shell. It’s handy if you are connecting to a server somewhere else on your network or your MongoDB Atlas clusters. If you want just the shell then run:

Brew Start Mongodb
Other Flavors
To make the server simple to start and stop, the brew services
command is supported. To start the server just do:
Start Mongodb Server
And, of course, to stop it cleanly do:
You can also install older versions of MongoDB using Brew’s version specifier. If you need to install MongoDB 3.6, for example, then you would run:
This installs the latest patch level of 3.6 so, as of writing, this would be 3.6.12. There's currently options for 3.4 and 3.6.
Talking about versions, you can start an upgrade from one MongoDB version to another with another quick command:
As with all upgrades, we do recommend you have a backup before running that though. Oh, and if you are wondering how you update the Brew Formula installed on your machine, don't worry, Brew does Formula updates automatically. One final note, the command brew info mongodb-community
will give you details on what version you have installed, where it came from and a reminder on how to use those brew services
commands to start and stop things.
All Open
If you find it useful, you’ll find more information in the GitHub repository for the MongoDB Formula, https://github.com/mongodb/homebrew-brew. If you want to improve the Formula then we are always ready for pull requests. You can also leave any feedback there via Github issues.
Enjoy the refreshing new way to install MongoDB on your Mac.
