- Install MongoDB >
- Install MongoDB on OS X
Install MongoDB on OS X¶
On this page
Platform Support
Starting in version 2.4, MongoDB only supports OS X versions 10.6 (Snow Leopard) on Intel x86-64 and later.
MongoDB 2.4 is available through the MongoDB Download site.
Manual Installation¶
Download the Latest Release¶
In a system shell, download the latest release for 64-bit OS X.
You may optionally specify a different version to download.
Extract MongoDB From Archive¶
Extract the files from the downloaded archive.
Optional: Copy MongoDB to Target Directory¶
Copy the extracted folder into another location, such as mongodb.
Optional: Configure Search Path¶
To ensure that the downloaded binaries are in your PATH, you can
modify your PATH and/or create symbolic links to the MongoDB
binaries in your /usr/local/bin directory
(/usr/local/bin is already in your PATH). You can find
the MongoDB binaries in the bin/ directory within the archive.
Run MongoDB¶
Set Up the Data Directory¶
Before you start mongod for the first time, you will need to
create the data directory. By default, mongod writes data to
the /data/db/ directory.
You can specify an alternate path for data files using the
--dbpath option to mongod. If
you use an alternate location for your data directory, ensure that the
alternate directory has the appropriate permissions.
Start MongoDB¶
To start mongod, run the executable mongod at the
system prompt.
For example, if your PATH includes the location of the
mongod binary, enter mongod at the system prompt.
If your PATH does not include the location of the mongod
binary, enter the full path to the mongod binary.
The previous command starts a mongod instance that writes
data to the /data/db/ directory. To specify an alternate data
directory, start mongod with the --dbpath option:
Whether using the default /data/db/ or an alternate directory,
ensure that the user account running mongod has read and
write permissions to the directory.