Victor Leung
Victor Leung
BlogFlower shop

Install MongoDB on Mac OS X

October 09, 2015

Firstly, install homebrew, which is the missing package management tool for OS X:

> ruby -e “$(curl -fsSL"

Then, update Formulae:

> brew update

And install the mongodb:

> brew install mongodb

To have launchd start mongodb at login:

> ln -sfv /usr/local/opt/mongodb/\*.plist ~/Library/LaunchAgents

Then to load mongodb now:

> launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

Or, if you don’t want/need launchctl, you can just run:

> mongod — config /usr/local/etc/mongod.conf

Also create the data directory.

> sudo mkdir -p /data/db

Don’t forget to change permission:

> sudo chown “whoami” /data/db

Finally start your database:

> mongod

About Victor Leung

Software development professional with expertise in application architecture, cloud solutions deployment, and financial products development. Possess a Master's degree in Computer Science and an MBA in Finance. Highly skilled in AWS (Certified Solutions Architect Professional, Developer and SysOps Administrator), GCP (Professional Cloud Architect), Microsoft Azure, Kubernetes(CKA, CKAD, CKS, KCNA), and Scrum(PSM, PSPO) methodologies.

Happy to connect

Continuous improvement

Copyright © 2023.