Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»MacOS»How To Install MongoDB on MacOS

    How To Install MongoDB on MacOS

    RahulBy RahulJune 24, 20192 Mins ReadUpdated:July 30, 2019

    MongoDB is a fully flexible index support and rich queries database. It is a NoSQL database. MongoDB 4.0 supports multi-document ACID transactions. This tutorial will help you to install MongoDB database server on macOS. After the installation, you may also like our MongoDB tutorial.

    Prerequisites

    • Terminal: You must have macOS terminal access and little knowledge about working with the command line.
    • Homebrew: Homebrew is a popular package management tools used for installing most open source software like Node. Here is the Homebrew installation tutorial

    Install MongoDB on MacOS

    First of all, update the Homebrew package repository index. Then install MongoDB using homebrew installer. This will install MongoDB at location /usr/local/Cellar/mongodb.

    brew update   
    brew install mongodb  
    

    Start/Stop MongoDB

    Start MongoDB – Use the following command to start MongoDB from a terminal. Make sure to change 4.0.3_1 in below command with the installed version of MongoDB on your macOS.

    launchctl load /usr/local/Cellar/mongodb/4.0.3_1/homebrew.mxcl.mongodb.plist  
    

    Stop MongoDB – Simply use the unload options to stop running MongoDB database service on macOS.

    launchctl unload /usr/local/Cellar/mongodb/4.0.3_1/homebrew.mxcl.mongodb.plist  
    

    Working with MongoDB

    After starting MongoDB service, just type “mongo” on the terminal. This will connect to MongoDB service running on the local system.

    mongo
    

    Install mongodb on macOS

    You can visit our MongoDB tutorial section to read and understand working with MongoDB.

    macOS mongodb
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow To Install MySQL 8.0 on CentOS 7/6
    Next Article How to Count Array Elements in PHP

    Related Posts

    How To Install Google Chrome On macOS

    Updated:August 10, 20223 Mins Read

    How to Create React.js Application on macOS

    4 Mins Read

    How to list all collections in MongoDB database

    1 Min Read

    Mongodb – Get the last record from collection

    1 Min Read

    #1 macOS and OS X Versions and Codenames

    Updated:August 10, 20223 Mins Read

    How To Setup Apache, PHP & MongoDB in Ubuntu & Debian

    Updated:October 8, 20213 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Import GPG Keys on Ubuntu & Debian (without apt-key)
    • How To Install Google Chrome On macOS
    • How to Install Minecraft on Ubuntu 22.04 & 20.04
    • Running a Cron job every Sunday (Weekly)
    • Running Multiple Commands At Once in Linux
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.