This tutorials explains about how to install mongodb on MacOS

Mongodb Provides two types of packages (msi and zip) to download and install on Windows.

There are multiple ways we can install any software on MacOS.

  • using homebrew

Install MongoDB on MacOS using homebrew

Following are steps by steps to download and install on Macos First , install xcode-select tools.

xcode-select --install

Next, install using homebrew

brew tap mongodb/brew

Next, Update brew tool to update dependencies

brew update

How to start/stop/restart mongoservice

run below command to start mongodb,

brew services start [email protected]

run below command to stop mongodb,

brew services stop [email protected]

run below command to restart mongodb,

brew services restart [email protected]

Mongodb Location on MacOS

Mongodb installation creates files in MAcOS file system based on processor type.

file types  Silicon Processor  Intel processor  
Mongo configuration/opt/homebrew/etc/mongod.conf/usr/local/etc/mongod.conf
log directory/opt/homebrew/var/log/mongodb/usr/local/var/log/mongodb
Data Directory/opt/homebrew/var/mongodb/usr/local/var/mongodb