My latest fascination is MongoDB, a document oriented database that stores data in the JSON format. It's a fast and simple to use database. And it's even easier to set up. This short post documents the basic setup and configuration needed to use MongoDB on OS X.
The first thing to do is to install Homebrew if you're one of the two people still not using Homebrew as you're package manager on OS X ^^. You install Homebrew by navigating to this page. The guide tells you issue the following command in Terminal (and install Xcode if you haven't):
ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"
When Homebrew is installed, it's time to install MongoDB using Homebrew.
brew install mongodb
Now, MongoDB is installed at
To start MongoDB, issue the following command in Terminal (in my case it's installed to 1.8.1-x86_64, adjust this to you're actual location):
mongod run --config /usr/local/Cellar/mongodb/1.8.1-x86_64/mongod.conf
MongoDB should now be up and running, to verify, in Terminal:
And you should see something like this:
MongoDB shell version: 1.8.1 connecting to: test
To list all databases, enter the following command:
That's it! You're now up and running MongoDB on you OS X machine.
To learn more:
- Homebrew: http://mxcl.github.com/homebrew/
- MongoDB Home: http://www.mongodb.org/
- MongDB doc's is located here: http://www.mongodb.org/display/DOCS/Home