Knowledge base · Studio 3T Desktop IDE

How to install a local MongoDB on macOS and connect to Studio 3T

By Kirsty Burgess · Updated

In this article, we’ll show you how to set up a local installation of MongoDB on your Mac and connect Studio 3T to the local MongoDB.

Want to know why you should install your own local MongoDB? Then read 5 Reasons You Should Install A Local MongoDB Database.

Watch the video on Vimeo

Prerequisites

You’ll be using the Homebrew package manager to install and manage your local installation of MongoDB. But first, you’ll need to install Apple’s Xcode command-line tools.

Install Xcode

In the Terminal app, run the following command:

xcode-select --install

Install Homebrew

In the Terminal app, run the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Find out more about the Homebrew brew package on the Homebrew site.

Install MongoDB

You’ll be installing MongoDB Community Edition. Find out more about this installation in the MongoDB documentation.

You’ll use the MongoDB Homebrew tap to install and start MongoDB.

  1. Add the MongoDB Homebrew tap. In the Terminal app, run the following command:
    brew tap mongodb/brew

  2. Install the MongoDB Community Edition:
    brew install mongodb-community

This installs the latest version of MongoDB. To install an older version, specify the version number, for example:
brew install [email protected]

  1. Run MongoDB. To start MongoDB as a service:
    brew services start mongodb-community

  2. Check that the MongoDB service is running:
    brew services list

If it is running, mongodb-community is listed as started.

Find out more about the MongoDB Homebrew tap, including stopping the MongoDB service or manually starting MongoDB and running it as a background process in the GitHub documentation.

Connect to Studio 3T

If you haven’t already done so, download and install the latest version of Studio 3T (Intel or Apple Silicon) for your Mac.

Open Studio 3T.

Click the Connect button in the top-left corner of the toolbar, and then click the New Connection button in the top-left corner of the Connection Manager dialog.

Create a new connection by clicking the Connect button and then the New Connection button on the Connection Manager

Or, on the Quickstart tab, click Create a new connection.

Create a new connection using the Quickstart tab

In the New Connection dialog, select Manually configure my connection settings and click Next.

Select Manually configure my connection settings to display the New Connection dialog

Name the connection and select Standalone from the Connection Type list. Set the Server and Port fields to localhost and the default port 27017.

Type a name for your local MongoDB connection

You can check that the connection works by clicking Test Connection.

Click Save. On the Connection Manager dialog, select the connection and click Connect.

The connection tree shows your connection to your local MongoDB.

The connection tree displays the new local MongoDB connection

You’re now ready to start importing data.

With your consent, we and third-party providers use cookies and similar technologies on our website to analyse your use of our site for market research or advertising purposes, including personalized advertising (“performance”), to provide you with additional functions (“functional”), and to show content from social media platforms, such as embedded videos (“social media”). This may result in the creation of pseudonymous usage profiles and the transfer of personal data to third countries, including the USA, which may have no adequate level of protection for the processing of personal data. Please choose for which purposes you wish to give us your consent and store your preferences by clicking on “Accept selected”. You can find further information in section 9 of our Privacy Policy.

Manage consent preferences