How to Install MongoDB on MacOS Catalina

In this article, I will share how to install MongoDB on MacOS Catalina.

First, I created a directory under the Library folder as shown below. /Users/onur/Library/Data/data/db

You can use any path as you want.


Then, I gave read and write privileges to these folders.

chmod -R 777 Data/

how to install mongodb on macos catalina

Under db folder, I run below commands.

brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community

Then I test mongo command as shown below:

I also run below command to point dbpath to my folder.

sudo mongod --dbpath /Users/onur/Library/Data/data/db


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.