In this tutorial, we will learn how to install MongoDB on macOS step by step.

so, let's get started,

If you are using Windows 10 or 11, click here.

Install MongoDB on macOS step by step

1. Install brew package manager for mac

Head over to https://brew.sh Copy the installation command from the homepage and paste it to your terminal.

Install-Brew
Install-Brew

2. Install the latest version of the node

brew install node

once the installation is completed, you can verify it by using node --version command

3. Install mongo

brew install mongo 

4. Create a DB folder for MongoDB 

sudo mkdir -P /data/db

5. Give read/write permission to the DB folder

sudo chown -Rv <user>/data/db

you can check your username by typing whoami command in terminal.

6. Verify Installation

now open two terminal tabs and type mongod  and mongo on another tab, it will start your MongoDB database.

๐Ÿ‘Great!!!our installation is completed and now our MongoDB is ready to use.

๐Ÿ’กTip:

you can use below command to  start mongodb automatically when system starts

brew services start mongo

Found this article helpful?

TutsCoder tutorials are free and ad-light โ€” supported by readers like you. Buy me a coffee (or two โ˜•โ˜•) as a token of appreciation and help keep Angular & Node.js content coming!

One-time. No subscription. 100% optional. ๐Ÿ™ Every coffee counts!

Leave a Comment

Your email will not be published. Spam-free zone. โœŒ๏ธ

Available for Projects

Need Help With Your
Angular or Node.js Project?

7+ years of MEAN Stack experience. I build scalable Angular 21 apps, Node.js APIs, and SaaS products โ€” delivered on time, every time.

7+ Years MEAN Stack Angular 21 + Nx Expert 20+ Projects Delivered Remote / Freelance