How to install MongoDB on mac osx





1. Navigate to https://www.mongodb.com/download-center from your browser

2. Inside MongoDB download center you will see three sub-tabs ‘Cloud’, ‘Server’ and ‘Tools’

3. Click on the ‘Server’ tab. You will be prompted to select the MongoDB version that you would like to download, the operating system of your machine(macOS in our case) and package.
4. On completion of prompted fields click on Download.

5. Your browser will download the MongoDB-macOS folder.

6. Paste this folder in your ‘Home Directory’.

7. Not able to find Home Directory? Inside finder click ‘Shift + Cmd + H’ You will be navigated to the home directory.

8. Past the downloaded MongoDB-macOS folder inside the home directory.

9. Now we have to set an environmental path so our machine can find MongoDB.

10. Open your .bash_profile file generally, it will be hidden you can find the hidden files by clicking ‘ Cmd+ Shift + .’ Now you should be able to see .bash_profile. If you don’t find any create a new file and save as ‘.bash_profile’

11. Set MongoDB path in .bash_profile. Attached sample bash_profile for reference

12. Restart your terminal




13. Now type a basic command to check you mongo setup is a success ‘mongo –version’. Command will respond with MongoDB version that you installed.