How to set up MongoDB on macOS using brew

The community edition of MongoDB can be set up on macOS using brew by following four simple steps.

The community edition of MongoDB can be set up on macOS using the following steps with homebrew:

MongoDB 5.0 Community Edition supports macOS 10.14 or later.
  • Tap the MongoDB Homebrew Tap:
brew tap mongodb/brew
  • Install MongoDB:
brew install mongodb-community@5.0
  • Once it's installed, start it as a macOS service by running the following:
brew services start mongodb-community@5.0
  • If you need to stop MongoDB running as a macOS service, use this command:
brew services stop mongodb-community@5.0

Did you find this information helpful? If so, consider heading over to my donation page and drop me some support or sign up for my newsletter.

Check out my other MongoDB posts.

Want to ask a question or just chat? Contact me here