# Installing MongoDB You can choose between installing MongoDB using comand line (instruction below) and download the package from [here](https://www.mongodb.com/try/download/community) ## Installing MongoDB for MacOS There are two way of installing MongoDB on MacOS: using `Homebrew` or using `.tgz` tarball. Find one that fit you. According to MongoDB Docs, if you can, it's better use `Homebrew` ### 1. Let's start installing using `Homebrew` #### Install Xcode Command-Line Tools Homebrew requires the Xcode command-line tools from Apple's Xcode. Run this command to install Xcode command-line ```terminal xcode-select --install ```` #### Install Homebrew macOS does not include the Homebrew brew package by default. Install `brew`: ```terminal $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` Read more about [Homebrew installation instructions](https://brew.sh/#install) #### Installing MongoDB 5.0 Community Edition Follow these steps to install MongoDB Community Edition using Homebrew's brew package manager. 1. To download the official Homebrew formula for MongoDB and the Database Tools ```terminal brew tap mongodb/brew ``` 2. To update Homebrew and all existing formulae: ```terminal brew update ``` 3. To install MongoDB, ```terminal brew install mongodb-community@5.0 ``` 4. To run MongoDB (i.e. the mongod process) as a macOS service, run: ```terminal brew services start mongodb-community@5.0 ``` To stop MongoDB running as a macOS service (this is useful when you have to restart your MongoDB), run: ```terminal brew services stop mongodb-community@5.0 ``` To stop 5. To verify that MongoDB is running, perform one of the following: ```terminal brew services list ``` Read more [here](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/) for other way. ### 2. Installing MongoDB using `.tgz` tarball > While MongoDB can be installed manually via a downloaded `.tgz` tarball, it is recommended to use the `brew` package manager on your system to install MongoDB if possible. Using a package manager automatically installs all needed dependencies and simplifies future upgrade and maintenance tasks. Therfore, if the the `brew` package doesn't work in your case for any reason, try [tarball](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x-tarball/) ## Installing MongoDB for Window Follow these steps to install MongoDB Community Edition using the MongoDB Installer wizard. ### 1. Download the installer [Download](https://www.mongodb.com/try/download/community?tck=docs_server) the MongoDB Community `.msi` installer ### 2. Run the MongoDB installer! Go to the directory where you downloaded the MongoDB installer. Then double-click the `.msi` file ### 3. Follow the MongoDB Community Edition installation wizard 1. Choose the **Complete** setup type. 2. Service Configuration ![](https://i.imgur.com/ywGYtBB.png) 3. Install MongoDB Compass Select Install MongoDB Compass (Default). 4. When ready, click **Install**. Read more about detail description [here](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-windows/) ## Further resources - A good to have certificate for better understanding of Mongo Ecosystem [M001 Mongo Certificate](https://university.mongodb.com/courses/M001/about) - Read more on the debate [SQL vs noSQL](https://www.guru99.com/sql-vs-nosql.html) - Fear of missing out ? [Add SQL to your arsenal](https://www.froglogic.com/blog/) - Download and install MongoDB Community Edition ([Windows](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/)) - Download and install MongoDB Community Edition([Mac](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/)) - Grab this free and easy certificate from MongoDB [M001 course](https://university.mongodb.com/courses/M001/about)