How to Install MongoDB on MacOS

0. Foreword

https://www.geeksforgeeks.org/mongodb/how-to-install-mongodb-on-macos/
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/

1. Install MongoDB Community Edition

1.1 Tap the MongoDB Homebrew Tap

1
brew tap mongodb/brew

1.2 To update Homebrew

1
brew update

1.3 To install MongoDB

1
brew install mongodb-community@8.0

2. Run MongoDB Community Edition

  • To run MongoDB (i.e. the mongod process) as a macOS service, run:
    1
    brew services start mongodb-community@8.0
    To stop a mongod running as a macOS service, use the following command as needed:
    1
    brew services stop mongodb-community@8.0

3. Connect and Use MongoDB

1
mongosh

How to Install MongoDB on MacOS
https://www.hardyhu.cn/2025/08/21/How-to-Install-MongoDB-on-MacOS/
Author
John Doe
Posted on
August 21, 2025
Licensed under