Installing MongoDB on Mac OS: Homebrew vs. Direct Download

Installing MongoDB on Mac OS: Homebrew vs. Direct Download
0

#1

I’m adding MongoDB to my dev environment, and I’m trying to figure out what the fundamental differences between installing with Homebrew and downloading the tarball from the website are. I’ve already downloaded MongoDB using Homebrew, but a couple of tutorials I watched said that it’s better to download the tarball from the website. Why?

I used this tutorial: How to Install the MEAN Stack on Mac OSX and followed the instructions up until step 5. I was really unclear what was happening in step 6, so I didn’t execute that last command:

mkdir data && echo 'mongod --config /usr/local/etc/mongod.conf --dbpath=data --rest "[email protected]" --httpinterface' > mongod.sh && chmod a+x mongod.sh && ./mongod.sh

Since then, I’ve created a /data/db directory from the root and run both mongod and mongo, including inserting some tests, and everything worked fine. I ran mongod with the command mongod --dbpath /data/db/.

Essentially, I’d like to know how the Hombrew and direct download installs differ and how my current setup might mess up future porjects, if at all. Thanks in advance!


#2

Just use homebrew.

Even on the official mongodb website, they have a link on how to install mongodb using homebrew.

The nice thing about homebrew is checking and installing updates/upgrades is as easy as doing

brew update
brew upgrade

Any missing dependencies are also installed for you.

but a couple of tutorials I watched said that it’s better to download the tarball from the website. Why?

Maybe it’s just the usual Linux elitist attitude. Both the mongodb.com tarball and homebrew installs the same latest version 3.4.9