Skip to content

Instantly share code, notes, and snippets.

@Pushplaybang
Created June 28, 2018 11:30
Show Gist options
  • Save Pushplaybang/acff9e46c5b153a41a1723e2023cd76f to your computer and use it in GitHub Desktop.
Save Pushplaybang/acff9e46c5b153a41a1723e2023cd76f to your computer and use it in GitHub Desktop.
Install and run mongo OSX

Installing Mongo on OSX with brew

We'll need to update brew, install mongo, setup the location where data will be stored and know how to stop and start the DB.

Get started:

# update brew
brew update

# install mongo
brew install mongo

# create a directory to store data 
mkidr -p /data/db

# if the above required sudo, use the following to make sure it has the right permissions
sudo chown -R `whoami` /data/db

this should have you setup and ready to go. To run mongo, we need to start the daemon with the following

mongod

this will have mongo up and running, use crtl+c to shut it down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment