You can also follow the guide here
- Mac OS official guide
- Windows official guide
- Linus official guide
I am on a Mac OS system, so I am writing this guide as well, more for personal information.
brew tap mongodb/brew
Follow these steps to install MongoDB Community Edition using the third-party brew package manager.
brew install mongodb-community@4.2
To run MongoDB (i.e. the mongod process) as a macOS service, issue the following:
brew services start mongodb-community@4.2
To stop a mongod running as a macOS service, use the following command as needed:
brew services stop mongodb-community@4.2