Install MongoDB on Apple M1 chip

April 06, 2022

In this article i will explain you about installing MongoDb 5.0 community edition on apple mac os m1 chip processor

Step 1: Install Xcode Command-Line Tools

Homebrew requires the Xcode command-line tools from Apple’s Xcode. Copy paste the following command in your macOS terminal

xcode-select --install


Step 2: Install Homebrew

Homebrew helps in installation of software on Apple’s operating system, macOS, as well as Linux. Copy paste the following command in your macOS terminal to install homebrew

/bin/bash -c "$(curl -fsSL"


Follow this link for more home brew commands Home brew installation.

Step 3: Installing MongoDB 5.0 Community Edition

  1. Run the following command , this will download the official Homebrew formula for MongoDB and the Database Tools
brew tap mongodb/brew


  1. To install MongoDB, run the following command in your macOS Terminal application:
brew install mongodb-community@5.0


As you can see in the above image mongodb is already installed in my computer so it is asking to re install

Once finish running above command you will be able to install

  • The mongod server
  • The mongos sharded cluster query router
  • The MongoDB Shell, mongosh


Step 4: Running MongoDB server and mongosh command

After finishing installation we need to start MongoDB server in order to run mongosh database queries and commands

  • To run MongoDB (i.e. the mongod process) as a macOS service, run:
brew services start mongodb-community@5.0


  • To stop a mongod running as a macOS service, use the following command as needed:
brew services stop mongodb-community@5.0


  • To run MongoDB (i.e. the mongod process) manually as a background process, run:
mongod --config /opt/homebrew/etc/mongod.conf --fork


Step 5: Watch our you tube video to follow the above steps