If you are like me, running mongo servers on cloud IDE's is just not the same as the customizations I have in my visual studio code. The need to test MongoDB servers locally sounds like an ideal option but I was running into issues trying to get the darn thing installed.
All the guides I found were over a year old and focused on OS-X or El Capitan. This one should work for Mac OS Catalina. This is an attempt to capture how to install MongoDB and run the Mongod (MongoDB Daemon) in some personal notes that may help someone in the future (at least myself). Originally, I tried following various installation guides that all failed to find the formula and ran into odd errors about directories that didn't exist is read-only. My hope is that this will be a good reference for you.
If you are running Catalina, the old way of changing permissions for
data/db
don't work !
Steps to Install MongoDB locally
Create/open a project or clone a repo then head to the folder above that one.
First, you need brew installed. You can find instructions for that here: https://brew.sh/, then run:
$ brew update && brew tap mongodb/brew $ brew install mongodb-community $ brew services start mongodb-community $ mongod --config /usr/local/etc/mongod.conf $ mongo > db.disableFreeMonitoring()
Seriously, it's that easy. No need to run chmod
like on other setups, you now have mongod and mongo running. You can test this by running:
> show dbs
You should see something like:
> show dbs admin 0.000GB config 0.000GB local 0.000GB >
This means you did it!
Drew is a seasoned DevOps Engineer with a rich background that spans multiple industries and technologies. With foundational training as a Nuclear Engineer in the US Navy, Drew brings a meticulous approach to operational efficiency and reliability. His expertise lies in cloud migration strategies, CI/CD automation, and Kubernetes orchestration. Known for a keen focus on facts and correctness, Drew is proficient in a range of programming languages including Bash and JavaScript. His diverse experiences, from serving in the military to working in the corporate world, have equipped him with a comprehensive worldview and a knack for creative problem-solving. Drew advocates for streamlined, fact-based approaches in both code and business, making him a reliable authority in the tech industry.