- Install MongoDB >
- Install MongoDB Community Edition >
- Install MongoDB Community Edition on macOS
Install MongoDB Community Edition on macOS¶
On this page
Overview¶
The following tutorial uses brew
to install MongoDB 3.2
Community Edition on macOS systems. To install a different version of
MongoDB, please refer to that version’s documentation.
Platform Support¶
Changed in version 3.2.19: MongoDB now requires macOS 10.8 or later.
MongoDB requires macOS version 10.8 (Mountain Lion) or later running on an x86_64 processor.
Install MongoDB Community Edition¶
Prerequisite¶
If you have previously tapped the official MongoDB formula repository, you can go directly to the Install MongoDB step.
If you have not previously tapped the official MongoDB formula repository, tap the official MongoDB formula repository to add to the formula list. From a terminal, issue the following:
Install MongoDB¶
From a terminal, issue the following:
In addition to the binaries, the install creates:
- the configuration file
(
/usr/local/etc/mongod.conf
) - the
log directory path
(/usr/local/var/log/mongodb
) - the
data directory path
(/usr/local/var/mongodb
)
Run MongoDB¶
From a terminal, issue the following to run MongoDB (i.e.
the mongod
process) in the foreground.
Alternatively, to run MongoDB as a macOS service, issue the
following (the process uses the /usr/local/etc/mongod.conf
file created during the install):