Manually Installing MongoDB on your Mac

MongoDB is amongst one of the most popular NoSQL DB solutions. In this post we are going to talk about, how to manually install MongoDB on a mac.

1. Download the binary file

curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.6.tgz

2. Extract the files from the archive

tar -zxvf mongodb-osx-x86_64-3.2.6.tgz

3. Copy the extracted archive

mkdir -p installation
cp -R -n mongodb-osx-x86_64-3.2.6/ installation

4. Add the location of the variabels in the PATH variable

export PATH=<$PWD to installation>/bin:$PATH

5. Create a Data Directory & set Permissions

mkdir -p /data/db
sudo chmod 0755 /data/db
sudo chown $USER /data/db

6. Run MongoDB

TerminallBuffer1 : mongod
TerminallBuffer2 : mongo

Comments