Skip to content

Instantly share code, notes, and snippets.

@emekaorjiani
Forked from nrollr/MongoDB_macOS_Sierra.md
Created February 10, 2018 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emekaorjiani/33e015e7aff36f7c611592f3ab088551 to your computer and use it in GitHub Desktop.
Save emekaorjiani/33e015e7aff36f7c611592f3ab088551 to your computer and use it in GitHub Desktop.
Install MongoDB on Sierra using Homebrew

Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MongoDB

At this time of writing, Homebrew has MongoDB version 3.2.10 as default formulae in its main repository :

  • Enter the following command : $ brew info mongodb
  • Expected output: mongodb: stable 3.2.10 (bottled)

To install MongoDB enter : $ brew install mongodb

Additional configuration

Homebrew

To load and start the MongoDB background service, open Terminal and execute the following commands :

  • Install brew services first : $ brew tap homebrew/services

  • Load and start the MongoDB service : $ brew services start mongodb.
    Expected output : Successfully started mongodb (label: homebrew.mxcl.mongodb)

  • Check of the MongoDB service has been loaded : $ brew services list 1

  • Verify the installed MongoDB instance : $ mongod --version.
    Expected output : db version v3.2.10

Comments

1 The brew services start mongodb - instruction is equal to :

ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
@emekaorjiani
Copy link
Author

Thank you so much for this tip. It was so helpful.

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