How to Install MongoDB on Mac | Install MongoDB on macOS

Поділитися
Вставка
  • Опубліковано 10 лют 2025
  • 🍏📦 *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:*
    Visit the official MongoDB website (www.mongodb.co...) and download the MongoDB Community Server for macOS.
    2. *Extract the Archive:*
    Once the download is complete, locate the downloaded file (usually a .tgz or .tar.gz archive) and extract it. You can do this by double-clicking on the file or using the terminal:
    ```bash
    tar -zxvf /path/to/downloaded/mongodb-osx-ssl-x86_64-4.x.x.tgz
    ```
    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

КОМЕНТАРІ • 158

  • @ibrahimthecoder
    @ibrahimthecoder 7 місяців тому +15

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

  • @krittiyaclark
    @krittiyaclark 9 місяців тому +3

    I had to run brew install mongodb-community@7.0 and continue from 5:00. Thank you, it was helpful!

  • @KnowledgeBoxInfinity
    @KnowledgeBoxInfinity 11 місяців тому +6

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

  • @bibaswanchakma6471
    @bibaswanchakma6471 Рік тому +4

    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 PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

  • @allanoliveira1444
    @allanoliveira1444 3 місяці тому +1

    well, this was really helpful. homebrew and apple has stopped caring about my old macbook pro. I could not get mangodb running like I've always been used to so this was a life saving alternative. thank you much!

  • @amitpareek9117
    @amitpareek9117 4 місяці тому +1

    I was struggling with installation of MongoDB, you have solved problem like that. Amazing man.

  • @zyanyavelazquez7821
    @zyanyavelazquez7821 4 місяці тому

    Hi! I just wanted to say thank you so much for this tutorial. I have been struggling for days trying to figure out why my mongod was not working properly when installing with homebrew. I decided to install it the way you suggested and woah- the error was gone! Thanks again for being a lifesaver!

  • @TheTechieEngineer
    @TheTechieEngineer 4 місяці тому +2

    After Searching for an hour, then your video help me alot thanks for this video

  • @rahulsahu5988
    @rahulsahu5988 9 місяців тому +2

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

  • @AliHassan-sm1cv
    @AliHassan-sm1cv 10 місяців тому +1

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

  • @md.rafiulbiswas4553
    @md.rafiulbiswas4553 10 місяців тому +4

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

  • @taed13
    @taed13 6 місяців тому +1

    this is the video i have been looking for for months thank you~~~

  • @mistersir3185
    @mistersir3185 11 місяців тому +2

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

  • @luzcarimelucumihernandez9375
    @luzcarimelucumihernandez9375 3 місяці тому +1

    Muchas muchaas gracias, soy de Colombia y me sirvió mucho el tutorial. Exactamente lo que buscaba 💯

  • @deemah683
    @deemah683 9 місяців тому +2

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

  • @Joncito95
    @Joncito95 9 місяців тому +1

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

  • @Pragna-bd8cf
    @Pragna-bd8cf 7 місяців тому +1

    Steps were very easy to follow. thanks.

  • @vikassingh-ec5vb
    @vikassingh-ec5vb 3 місяці тому

    Very nice video , It helped , stuck for long time , finally it worked , Thanks man

  • @sandeepvinay7
    @sandeepvinay7 11 місяців тому

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

  • @dhruveshshyara-s3j
    @dhruveshshyara-s3j 22 дні тому

    Thanks for your instructions i would able to easily install mongodb🎉🎉

  • @rajeshjangid4617
    @rajeshjangid4617 7 місяців тому

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

  • @opmarathi64
    @opmarathi64 11 місяців тому +1

    Thank you so much sir. plz keep it up😊

  • @Powaup
    @Powaup 2 місяці тому

    They should pay you to have this next to their download page. thank you!

  • @oariasz72
    @oariasz72 11 місяців тому

    Excellent my friend! It worked flawlessly.

  • @Rishkumar
    @Rishkumar 4 місяці тому +1

    Its possible some people have server is still running when they close the terminal and Cannot use anything else
    Just run command in terminal
    Ps aux | grep mongod
    See if any processes are still running for mongodb and note down the process ids(typically pids are 5 digits in second column)
    And Next command-
    Sudo kill -9
    Then force close and reopen and check it shall be working

  • @fafner333
    @fafner333 Місяць тому

    Thank you so much. You save my day :)

  • @AyushSingh-lb5jt
    @AyushSingh-lb5jt 8 місяців тому

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

    • @romangautam932
      @romangautam932 3 місяці тому

      do you know how do i start mongodb compass next time. I mean i followed each step it works .now im simply opening compass again error occured. do i need to do something in terminal each time i open compass?

  • @kingannon4131
    @kingannon4131 10 місяців тому

    Fantastic video, thanks for the help!

  • @jinluwang5671
    @jinluwang5671 10 місяців тому +2

    Thanks. I installed it with home brew following the instructions on MongoDB website. Any difference?

  • @nitinsahu4753
    @nitinsahu4753 Місяць тому

    Thank you for this tutorial.

  • @rakeshkm1360
    @rakeshkm1360 3 місяці тому

    made installation simple, thanks

  • @morningstarknows320
    @morningstarknows320 3 місяці тому

    this video is super helpful

  • @ABDELAZIZCHAIMA
    @ABDELAZIZCHAIMA 6 місяців тому

    Thank you, It was so helpful

  • @anshit1616
    @anshit1616 3 місяці тому

    Thanks this helped a lot

  • @wonderweebwoman
    @wonderweebwoman 9 місяців тому

    Detailed instructions. Thanks!!

  • @siyarana1379
    @siyarana1379 6 місяців тому

    thankyou so much , very helpful

  • @rcstevenson6
    @rcstevenson6 Рік тому

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

  • @leandroclaudio
    @leandroclaudio 2 місяці тому

    Thank you! Thank you! Thank you!

  • @lachezarninkov
    @lachezarninkov 8 місяців тому

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

  • @vishnuvardhanvankayalapati7703
    @vishnuvardhanvankayalapati7703 5 місяців тому

    It helped, Thank you!

  • @vedanshgupta9446
    @vedanshgupta9446 Місяць тому

    Hello, could you please make a video on what are the options for running C# and dotnet in silicon chip based macs as microsoft has stopped the support for visual studio for macOS

  • @ytrollers
    @ytrollers 10 місяців тому

    Thankyou so much, that video is really helpful

  • @Shaytube635
    @Shaytube635 21 день тому

    really a very helpful video

  • @قهقان
    @قهقان 6 місяців тому

    Thanks, you're a lifesaver

  • @rachdev_codeur
    @rachdev_codeur 8 місяців тому

    Thanks you very much. Your video helps me

  • @suneel8715
    @suneel8715 10 місяців тому

    Good explaination

  • @nelsonberm3910
    @nelsonberm3910 16 днів тому

    Thank you for the video

  • @aniketkhandagale5098
    @aniketkhandagale5098 7 місяців тому

    suoerb video.. Very well explained. Help me setup my mongo on mac

  • @cesarmotril
    @cesarmotril Рік тому +2

    Bro gracias, probablemente no entiendas esto pero te quiero

  • @elyse2717
    @elyse2717 4 місяці тому

    Thank you Thank you Thank you!!!

  • @AbhaySingh-ok2ol
    @AbhaySingh-ok2ol 6 місяців тому

    thank you so much man i was going to throm is mac opreators just frustrated the hell out of me man

  • @aaronlopes5307
    @aaronlopes5307 3 місяці тому

    GOAT tutorial

  • @armindervic9497
    @armindervic9497 9 місяців тому

    Awesome video!

  • @itsmenavyaaaa
    @itsmenavyaaaa 11 місяців тому +2

    i have M1 macbook, which community server version should i download?

  • @saurabh-sharma
    @saurabh-sharma 2 місяці тому

    Great video

  • @EminYusifov
    @EminYusifov 7 місяців тому

    great! easy ) thanks

  • @ГерманХамитов-ж4ь
    @ГерманХамитов-ж4ь 9 місяців тому

    Thank you very much!

  • @ettyobz
    @ettyobz 10 місяців тому

    excellent, very helpful

  • @joKerchy
    @joKerchy 11 місяців тому

    Thank you soo much :)

  • @soham5791
    @soham5791 6 місяців тому

    bhai crazy hai tu

  • @santd3400
    @santd3400 9 місяців тому

    Thanks bro !

  • @dixavier27
    @dixavier27 5 місяців тому

    How to configurate the user and permissions locally, u would make a video?

  • @Ferassharkh
    @Ferassharkh 4 місяці тому

    very useful

  • @favourdaniel2410
    @favourdaniel2410 Рік тому

    Thank you!

  • @Alejandroponce00
    @Alejandroponce00 Місяць тому

    gracias,me sirvio!

  • @nadejdaanastasova9654
    @nadejdaanastasova9654 9 днів тому

    Thank you !!!

  • @BhupeshKumarSinghBCE
    @BhupeshKumarSinghBCE 8 місяців тому

    thanks, it worker fine

  • @MishtiTheTzu
    @MishtiTheTzu Місяць тому

    downloaded as mentioned but on terminal when giving command cd downloads the file is not showing up. how to proceed ?

  • @nelsonmunthe4571
    @nelsonmunthe4571 4 місяці тому

    thanks a lot

  • @TirthTimaniya
    @TirthTimaniya 3 місяці тому

    in export path = what should be the {PATH} and from where I can set that value in mac. I am new to the mac please help

  • @raider4407
    @raider4407 8 місяців тому +5

    Hello sir , i am having issue with this command which is sudo mongo -dbpath==/User/MacBook/data/db its showing me a pop-up message that includes mongo D cannot be opened because Apple cannot check it for malicious software. The software needs to be updated, contact developer for more information what to do please help me

    • @Nitrox_settings
      @Nitrox_settings 8 місяців тому

      same problem

    • @bocamaster
      @bocamaster 8 місяців тому +4

      Go to system preferences->security & privacy -> General and enable changes on this tab by clicking on the locker in the bottom of the page. Then allow mongod to be opened on your mac

  • @frankpulido873
    @frankpulido873 4 місяці тому

    I am sure this is a silly question, but here I go anyway : Is it necessary to have Mongo DB Shell installed as a requirement to install and run Mongo DB Compass?...

  • @samsstandup9149
    @samsstandup9149 6 місяців тому +4

    in my mac it shows me a error to contact developer and says that the apple cannot scan this for malicious software

    • @arulpraveen
      @arulpraveen 5 місяців тому +2

      just go to system preferences > Privacy & Security > scroll down and click "allow anyways" mongod

  • @calabert
    @calabert 21 день тому

    Thanks!

  • @shreyaschaudhary-r6d
    @shreyaschaudhary-r6d 8 місяців тому

    thank you

  • @alikhaled2389
    @alikhaled2389 8 місяців тому

    At 8:03 my mongod command isn’t working, it says:
    ‘“mongod” can’t be opened because Apple cannot check it for malicious software. This software needs to be updated. Contact the developer for more information.’ And it gives me two options, “Show in Finder” and “OK”
    What the hell do I do?

    • @ajjayadhithyav8873
      @ajjayadhithyav8873 7 місяців тому

      after running the command, just open your system preferences then go to privacy and security scroll down and then you can see mongod will be blocked, just click on allow there and other steps will work as you move through the video!

  • @YoursTrulyNatalie_Games
    @YoursTrulyNatalie_Games 3 місяці тому

    Hello, I have a question how do I access mongosh in a different terminal window? it says zsh: command not found: mongosh, do I have to do the downloading process over again? Thanks!

  • @FrancisLukoki-t8c
    @FrancisLukoki-t8c 11 місяців тому

    Thank u !!!!!

  • @ksrajavel
    @ksrajavel 2 місяці тому

    Saver video again!!!

  • @sinnie.62.
    @sinnie.62. 9 місяців тому

    After closing the connection with Mongod terminal will the compass work or do I have to keep it running in the background to work on the compass?

  • @竹内悠人-z7w
    @竹内悠人-z7w 2 місяці тому

    感謝します。

  • @Crisgonzalez94
    @Crisgonzalez94 6 місяців тому

    Thankyou

  • @igreels1033
    @igreels1033 9 місяців тому +1

    How to restart server after successful installation

  • @AbhishekMishra-qw3cd
    @AbhishekMishra-qw3cd 11 місяців тому

    give me the command for restart the mongodb server by any chance if it get closed

  • @dhakaluma3613
    @dhakaluma3613 11 місяців тому +1

    after someday, if we want to try to open mongo db compass , it shows an error while connecting i.e ECONNREFUSED like this? why?

    • @rajatpanwal
      @rajatpanwal 6 місяців тому

      how did you fix it??????

    • @dhakaluma3613
      @dhakaluma3613 6 місяців тому +1

      @@rajatpanwal Yes , it is fixed now , we have to use that last command in our terminal.

  • @liderbektas3097
    @liderbektas3097 6 місяців тому

    kral ya kral

  • @gaurviisood7072
    @gaurviisood7072 8 місяців тому +1

    please help it is showing me
    “mongod” can’t be opened because Apple cannot check it for malicious software.

    • @kanishkayadav4007
      @kanishkayadav4007 7 місяців тому +1

      System settings -> security and privacy -> allow apps to download from appstore

  • @SRUSHTIHIRVE-h2l
    @SRUSHTIHIRVE-h2l 10 місяців тому

    hello can anyone tell me how to install mongo db shell on M1 CHIP , it's giving me a lot of issues

  • @DA-rf7zj
    @DA-rf7zj 5 місяців тому

    What? A quarter of the way through the 21st Century and the mongodb software is straight out of the '80s. Can't believe any Mac owner would use it.

  • @Programming-for-all-u2l
    @Programming-for-all-u2l 11 місяців тому +12

    after following your video instructions for installing Mongodb my terminal is not working. Thank you

    • @annnaaa1510
      @annnaaa1510 10 місяців тому

      Mine too

    • @_DivyaBharti
      @_DivyaBharti 9 місяців тому

      Mine too. Please tell how did u fix it. Please

    • @_DivyaBharti
      @_DivyaBharti 9 місяців тому

      😢😢

    • @togariakshath29
      @togariakshath29 9 місяців тому

      Yeah, can anyone please help me how to do it

    • @alikhaled2389
      @alikhaled2389 8 місяців тому

      @@togariakshath29 guys, is it the same error as in my comment? If anyone got the same, please help me, I have an exam after tomorrow and I need mongo to work

  • @RitikGupta060
    @RitikGupta060 4 місяці тому

    hey i am not getting mongoshell option even it is enable to intract

  • @akshithanilkumar8557
    @akshithanilkumar8557 4 місяці тому

    touch: .zshrc: Permission denied.... can anyone give me a solution for this??

  • @vipundenuwan9293
    @vipundenuwan9293 9 місяців тому +2

    Hi
    My .zshrc file is locked because there is anaconda codes. So I can't paste the path there. Any solution for this issue?

    • @cheptooM
      @cheptooM 19 днів тому

      did you find the solution?

  • @dh1569
    @dh1569 9 місяців тому

    Just curious, has anyone ever gotten mongodb to work on a mac - without compass?

  • @Onlylearningthat
    @Onlylearningthat 2 місяці тому

    way of in your mac system And way of in my mac are different 😟
    so it was difficult for me 🤯

  • @LycheeLele-mh2ku
    @LycheeLele-mh2ku 5 місяців тому +1

    Wow, u managed to make this waaaaay more complicated than it needs to be

  • @MuhdHanish
    @MuhdHanish 8 місяців тому

    bro how to stop the services running i have 2 services running how to stop them

  • @ArnavShukla
    @ArnavShukla 3 місяці тому

    command not found is coming when I run mongod after running source .zshrc and clear

    • @cheptooM
      @cheptooM 19 днів тому

      did you fingd the solution

  • @SVARUOK
    @SVARUOK 2 місяці тому

    indians are saviours

  • @nabeanrokaya3691
    @nabeanrokaya3691 7 місяців тому

    there is an error saying "mongod" cant be opened becuase apple cannot check it for malicious software -this software neeeds to be updated. contact the developer for more information 'what should i do now"

    • @simranm.552
      @simranm.552 6 місяців тому +1

      for this issue click on apple icon-> go to system setting-> security and privacy-> scroll down you'll see something like "mongod" something click on "open anyway"