How to Install MongoDB on Mac | Install MongoDB on macOS (2024)

preview_player
Показать описание
🍏📦 **No Homebrew Needed: How to Install MongoDB on Mac (M1, M2, M3, MacBook Pro, MacBook Air) Without Homebrew and Configure in Zsh!** 🚀🖥️

If you prefer not to use Homebrew, you can manually download and install MongoDB on your Mac. Additionally, we'll cover setting up MongoDB in the Zsh shell.

🌟 **Step-by-Step Guide:**
1. **Download MongoDB:**

2. **Extract the Archive:**
```bash
```

3. **Move MongoDB to /usr/local:**
- Move the extracted MongoDB folder to `/usr/local` for easier access:
```bash
sudo mv mongodb-osx-ssl-x86_64-4.x.x /usr/local/mongodb
```

4. **Create Data Directory:**
- MongoDB requires a data directory. Create one using:
```bash
sudo mkdir -p /usr/local/var/mongodb
```

5. **Set Permissions:**
- Set proper permissions for the data directory:
```bash
sudo chown -R $(whoami) /usr/local/var/mongodb
```

6. **Add MongoDB Binaries to PATH:**
- To access MongoDB from any location in the terminal, add the MongoDB binaries to your shell's PATH. If you're using Zsh, edit your Zsh configuration file (usually `~/.zshrc`):
```bash
nano ~/.zshrc
```
Add the following line at the end:
```bash
export PATH="/usr/local/mongodb/bin:$PATH"
```
Save and exit.

7. **Restart Zsh or Source the Configuration:**
- Restart Zsh or source the updated configuration:
```bash
source ~/.zshrc
```

8. **Start MongoDB:**
- Start MongoDB by running:
```bash
mongod --dbpath /usr/local/var/mongodb
```

9. **Verify Installation:**
- Open a new terminal window and run the MongoDB shell:
```bash
mongo
```
You should see the MongoDB shell prompt.

10. **Explore MongoDB:**
- You're ready to explore MongoDB! Use commands like `show dbs` and `use your_database_name` to get started.

11. **Stop MongoDB (Optional):**
- If you want to stop MongoDB, press **Ctrl + C** in the terminal where MongoDB is running.

🚀 **Additional Tips:**
- **Configure MongoDB as a Service (Optional):**
- To run MongoDB as a service, create a launch agent plist file. Refer to the MongoDB documentation for detailed instructions.

- **Upgrade MongoDB Version:**
- To upgrade MongoDB, download the latest version, repeat the installation steps, and replace the old binaries.

🍃 **Congratulations! You've successfully installed MongoDB on your Mac without Homebrew and configured it to work seamlessly with Zsh!**

🍃 **Hashtags:**
#MongoDB #MacOS #DatabaseInstallation #TechTutorial #NoHomebrew #ZshConfiguration #DevelopmentEnvironment #ManualInstallation #TechHowTo
Рекомендации по теме
Комментарии
Автор

woah you saved my coding journey. such a complex installation of mongodb in mac explained in a simple step by step manner. Thanks :)

KnowledgeBoxInfinity
Автор

I was frustrated to install Mongodb on Mac but this video makes it so simple. Thanks for making

ibrahimthecoder
Автор

Thank you for the video! Steps were very easy to follow and you went at a great pace.

Joncito
Автор

Thanks for the step by step details to install mongodb in mac system. Very nicely explained.👌

sandeepvinay
Автор

Thank you so much! This was a helpful and easy to follow tutorial. Very appreciated ❤

deemah
Автор

Very well prepared video step by step. Big Thanks for contributing to the community

md.rafiulbiswas
Автор

Steps were very easy to follow. thanks.

Pragna-bdcf
Автор

Excellent my friend! It worked flawlessly.

oariasz
Автор

Lazawaab, maza aagaya
every step goes so smoothly
thank you so much

AyushSingh-lbjt
Автор

"Thanks a lot! This was really helpful for me and other users. Awesome blog video, thanks again!"

rajeshjangid
Автор

Thank you so much... this was fantastic. Very thorough too.

rcstevenson
Автор

Thank you so much sir. plz keep it up😊

opmarathi
Автор

Thank you for this! I can assure you that it's working.

mistersir
Автор

This is my first comment on youtube just for you amazing explanation sir. Just looking like a wao.

AliHassan-smcv
Автор

budddy love you you dont knwo how much i feel for you after running my mongo

rahulsahu
Автор

Thankyou so much, that video is really helpful

ytrollers
Автор

thanks a lot for the video. Really helpful

iamakramfaiz
Автор

Thank you so much! this saved my life.
At 8:45 if your 'ls', 'mkdir' or any other commands don't work, just copy paste the following in your .zshrc file and save -
export

bibaswanchakma
Автор

Fantastic video, thanks for the help!

kingannon
Автор

Hi, thank you for the video it helped me a lot

lachezarninkov