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

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ต.ค. 2024
  • 🍏📦 *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

ความคิดเห็น • 116

  • @ibrahimthecoder
    @ibrahimthecoder 3 หลายเดือนก่อน +5

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

  • @amitpareek9117
    @amitpareek9117 17 วันที่ผ่านมา

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

  • @zyanyavelazquez7821
    @zyanyavelazquez7821 2 วันที่ผ่านมา

    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 10 วันที่ผ่านมา

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

  • @krittiyaclark
    @krittiyaclark 4 หลายเดือนก่อน

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

  • @KnowledgeBoxInfinity
    @KnowledgeBoxInfinity 7 หลายเดือนก่อน +3

    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 8 หลายเดือนก่อน +1

    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"

    • @ijatin1213
      @ijatin1213 3 หลายเดือนก่อน +1

      thankksss

  • @rajeshjangid4617
    @rajeshjangid4617 2 หลายเดือนก่อน

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

  • @deemah683
    @deemah683 4 หลายเดือนก่อน +1

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

  • @md.rafiulbiswas4553
    @md.rafiulbiswas4553 5 หลายเดือนก่อน +1

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

  • @taed13
    @taed13 2 หลายเดือนก่อน

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

  • @mistersir3185
    @mistersir3185 7 หลายเดือนก่อน +1

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

  • @prixescalator5764
    @prixescalator5764 14 วันที่ผ่านมา

    Excellent tutorial, thank you so much!

  • @rahulsahu5988
    @rahulsahu5988 5 หลายเดือนก่อน

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

  • @AyushSingh-lb5jt
    @AyushSingh-lb5jt 3 หลายเดือนก่อน

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

  • @Joncito95
    @Joncito95 5 หลายเดือนก่อน

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

  • @sandeepvinay7
    @sandeepvinay7 7 หลายเดือนก่อน

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

  • @Pragna-bd8cf
    @Pragna-bd8cf 3 หลายเดือนก่อน

    Steps were very easy to follow. thanks.

  • @AliHassan-sm1cv
    @AliHassan-sm1cv 6 หลายเดือนก่อน

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

  • @oariasz72
    @oariasz72 7 หลายเดือนก่อน

    Excellent my friend! It worked flawlessly.

  • @janpoonthong
    @janpoonthong 23 วันที่ผ่านมา

    Thanks a lot, very helpful video

  • @wonderweebwoman
    @wonderweebwoman 5 หลายเดือนก่อน

    Detailed instructions. Thanks!!

  • @opmarathi64
    @opmarathi64 7 หลายเดือนก่อน +1

    Thank you so much sir. plz keep it up😊

  • @AbhaySingh-ok2ol
    @AbhaySingh-ok2ol 2 หลายเดือนก่อน

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

  • @ABDELAZIZCHAIMA
    @ABDELAZIZCHAIMA หลายเดือนก่อน

    Thank you, It was so helpful

  • @mayurvaghasiya3609
    @mayurvaghasiya3609 วันที่ผ่านมา

    thank you for the help

  • @TheJomad
    @TheJomad 28 วันที่ผ่านมา

    super helpful!

  • @siyarana1379
    @siyarana1379 2 หลายเดือนก่อน

    thankyou so much , very helpful

  • @kingannon4131
    @kingannon4131 6 หลายเดือนก่อน

    Fantastic video, thanks for the help!

  • @قهقان
    @قهقان 2 หลายเดือนก่อน

    Thanks, you're a lifesaver

  • @vishnuvardhanvankayalapati7703
    @vishnuvardhanvankayalapati7703 หลายเดือนก่อน

    It helped, Thank you!

  • @iamakramfaiz
    @iamakramfaiz 5 หลายเดือนก่อน

    thanks a lot for the video. Really helpful

  • @lachezarninkov
    @lachezarninkov 4 หลายเดือนก่อน

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

  • @rachdev_codeur
    @rachdev_codeur 4 หลายเดือนก่อน

    Thanks you very much. Your video helps me

  • @elyse2717
    @elyse2717 13 วันที่ผ่านมา

    Thank you Thank you Thank you!!!

  • @armindervic9497
    @armindervic9497 4 หลายเดือนก่อน

    Awesome video!

  • @sanoj1736
    @sanoj1736 หลายเดือนก่อน

    Thank you!

  • @aniketkhandagale5098
    @aniketkhandagale5098 3 หลายเดือนก่อน

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

  • @cesarmotril
    @cesarmotril 8 หลายเดือนก่อน +2

    Bro gracias, probablemente no entiendas esto pero te quiero

  • @suneel8715
    @suneel8715 6 หลายเดือนก่อน

    Good explaination

  • @EminYusifov
    @EminYusifov 3 หลายเดือนก่อน

    great! easy ) thanks

  • @soham5791
    @soham5791 หลายเดือนก่อน

    bhai crazy hai tu

  • @dixavier27
    @dixavier27 หลายเดือนก่อน

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

  • @frankpulido873
    @frankpulido873 11 วันที่ผ่านมา

    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?...

  • @Ferassharkh
    @Ferassharkh 15 วันที่ผ่านมา

    very useful

  • @kia8609
    @kia8609 6 หลายเดือนก่อน

    Thank you so much :)

  • @LycheeLele-mh2ku
    @LycheeLele-mh2ku หลายเดือนก่อน

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

  • @santd3400
    @santd3400 5 หลายเดือนก่อน

    Thanks bro !

  • @samsstandup9149
    @samsstandup9149 หลายเดือนก่อน +3

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

    • @arulpraveen
      @arulpraveen หลายเดือนก่อน +2

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

  • @raider4407
    @raider4407 4 หลายเดือนก่อน +4

    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 4 หลายเดือนก่อน

      same problem

    • @bocamaster
      @bocamaster 4 หลายเดือนก่อน +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

  • @igreels1033
    @igreels1033 5 หลายเดือนก่อน +1

    How to restart server after successful installation

  • @jinluwang5671
    @jinluwang5671 6 หลายเดือนก่อน +1

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

  • @itsmenavyaaaa
    @itsmenavyaaaa 7 หลายเดือนก่อน +1

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

  • @BhupeshKumarSinghBCE
    @BhupeshKumarSinghBCE 4 หลายเดือนก่อน

    thanks, it worker fine

  • @gaurviisood7072
    @gaurviisood7072 3 หลายเดือนก่อน +1

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

    • @kanishkayadav4007
      @kanishkayadav4007 3 หลายเดือนก่อน +1

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

  • @liderbektas3097
    @liderbektas3097 2 หลายเดือนก่อน

    kral ya kral

  • @vipundenuwan9293
    @vipundenuwan9293 5 หลายเดือนก่อน +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?

  • @Crisgonzalez94
    @Crisgonzalez94 หลายเดือนก่อน

    Thankyou

  • @shreyaschaudhary-r6d
    @shreyaschaudhary-r6d 4 หลายเดือนก่อน

    thank you

  • @RitikGupta060
    @RitikGupta060 22 วันที่ผ่านมา

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

  • @FrancisLukoki-t8c
    @FrancisLukoki-t8c 7 หลายเดือนก่อน

    Thank u !!!!!

  • @akshithanilkumar8557
    @akshithanilkumar8557 10 วันที่ผ่านมา

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

  • @Nothingtosaymore
    @Nothingtosaymore 27 วันที่ผ่านมา

    6:05 how select path in MacBook

  • @DA-rf7zj
    @DA-rf7zj 25 วันที่ผ่านมา

    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.

  • @princethakkar6642
    @princethakkar6642 หลายเดือนก่อน

    im having trouble running mongod in my terminal can anyone help

  • @Programming-for-all-u2l
    @Programming-for-all-u2l 7 หลายเดือนก่อน +9

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

    • @annnaaa1510
      @annnaaa1510 5 หลายเดือนก่อน

      Mine too

    • @_DivyaBharti
      @_DivyaBharti 5 หลายเดือนก่อน

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

    • @_DivyaBharti
      @_DivyaBharti 5 หลายเดือนก่อน

      😢😢

    • @togariakshath29
      @togariakshath29 5 หลายเดือนก่อน

      Yeah, can anyone please help me how to do it

    • @alikhaled2389
      @alikhaled2389 3 หลายเดือนก่อน

      @@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

  • @ovijitkarmakar7804
    @ovijitkarmakar7804 หลายเดือนก่อน

    but mongo command done not work

  • @abdulragib6004
    @abdulragib6004 2 หลายเดือนก่อน

    its better to use homebrew

  • @sinnie.62.
    @sinnie.62. 5 หลายเดือนก่อน

    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?

  • @nabeanrokaya3691
    @nabeanrokaya3691 3 หลายเดือนก่อน

    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 หลายเดือนก่อน +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"

  • @MuhdHanish
    @MuhdHanish 4 หลายเดือนก่อน

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

  • @dhakaluma3613
    @dhakaluma3613 6 หลายเดือนก่อน +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 2 หลายเดือนก่อน

      how did you fix it??????

    • @dhakaluma3613
      @dhakaluma3613 2 หลายเดือนก่อน +1

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

  • @dh1569
    @dh1569 5 หลายเดือนก่อน

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

  • @AbhishekMishra-qw3cd
    @AbhishekMishra-qw3cd 6 หลายเดือนก่อน

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

  • @SRUSHTIHIRVE-h2l
    @SRUSHTIHIRVE-h2l 6 หลายเดือนก่อน

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

  • @alikhaled2389
    @alikhaled2389 3 หลายเดือนก่อน

    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 3 หลายเดือนก่อน

      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!

  • @ReddyReddy-o7n
    @ReddyReddy-o7n 8 หลายเดือนก่อน

    Hello how to create partition in Ubuntu doing video

  • @casket_kicker
    @casket_kicker 6 หลายเดือนก่อน +2

    Thank you for the great tutorial. I got stuck on security issues where my mac would kill the command, if anyone else is having security issues with their mac I used this video to trouble shoot: th-cam.com/video/wpJnigMKFmQ/w-d-xo.html. Othere than that this video has everything you need to get going with mongo on mac.

  • @TravelWorld-z8k
    @TravelWorld-z8k 2 วันที่ผ่านมา

    how to download mongodb -buy a windows

  • @nitishkumarjakkula1724
    @nitishkumarjakkula1724 22 วันที่ผ่านมา +1

    very frustating using mac fuck ittttttttttt!!!!!!!!!!!!!!!!!!!!!!!

  • @kunli1205
    @kunli1205 หลายเดือนก่อน

    My problem is mkdir: /data: Read-only file system, but I create another directory by enter: mkdir -p ~/mongodb/data, then use chmod -R 755 ~/mongodb/data to make sure I owned thsi directory, then use --dbpath option to specify the new directory when starting mongod:mongod --dbpath ~/mongodb/data. Finally fix this issue.

  • @tausifkazi3205
    @tausifkazi3205 3 หลายเดือนก่อน

    Bootstrap failed: 5: Input/output error
    ta**************@T****-Laptop ~ % brew services start mongodb-community@7.0
    Bootstrap failed: 5: Input/output error
    Try re-running the command as root for richer errors.
    Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/ta************/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist` exited with 5.
    I am facing this issue while starting the Mongodb server. Can you suggest?

  • @thehalise
    @thehalise 7 หลายเดือนก่อน

    Hello, I'm trying to install MongoDb but I have a problem ".zshrc" part.
    When I type "source .zshrc" on terminal, I'm getting this error:
    ".zshrc:export:15: not valid in this context: /Users/XXX/mongodb-macos-aarch64-7.0.6/bin"
    And I did all the things in the video, one by one.
    ***
    .zshrc path is =
    export PATH=${PATH}: /Users/XXX/mongodb-macos-aarch64-7.0.6/bin
    I need help about error.

    • @thehalise
      @thehalise 7 หลายเดือนก่อน

      ok ok I got it :) I left 1 space while writing, before "/Users". 😬 Now it's working.

  • @rcstevenson6
    @rcstevenson6 8 หลายเดือนก่อน

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

  • @rahuljha972
    @rahuljha972 3 หลายเดือนก่อน

    thnnks for such nice video , great job

  • @nawwintphyu1873
    @nawwintphyu1873 2 หลายเดือนก่อน

    Thank you so much!

  • @ettyobz
    @ettyobz 6 หลายเดือนก่อน

    excellent, very helpful

  • @emekatimothyiloba699
    @emekatimothyiloba699 3 หลายเดือนก่อน

    Big Thanks sir

  • @joKerchy
    @joKerchy 7 หลายเดือนก่อน

    Thank you soo much :)

  • @ytrollers
    @ytrollers 5 หลายเดือนก่อน

    Thankyou so much, that video is really helpful

  • @ГерманХамитов-ж4ь
    @ГерманХамитов-ж4ь 5 หลายเดือนก่อน

    Thank you very much!

  • @sunnykulshrestha2155
    @sunnykulshrestha2155 4 หลายเดือนก่อน

    Thanks helped me

  • @arafathussain851
    @arafathussain851 4 หลายเดือนก่อน

    Thank you!

  • @favourdaniel2410
    @favourdaniel2410 7 หลายเดือนก่อน

    Thank you!