$ brew tap mongodb/brew
$ brew install mongodb-community@4.4
Default Paths for the mongodb-community Formula
In addition to installing the MongoDB server and tool binaries, the mongodb-community
formula creates:
- a configuration file:
/usr/local/etc/mongod.conf
- a log directory path:
/usr/local/var/log/mongodb
- a data directory path:
/usr/local/var/mongodb
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