Navigation

Connect via Compass

The Connect dialog for a cluster provides the details to connect to a cluster using Compass.

Use MongoDB Compass 1.5 or later to connect to Atlas clusters. These versions support the required SNI TLS extension.

To complete this procedure you must have MongoDB Compass installed. To install MongoDB Compass, do one of the following:

  • Follow the Installation Procedure in the MongoDB Compass documentation.
  • Download and install the latest version of MongoDB Compass using the download links provided in the Atlas Connect dialog. To access these links, click Connect for the cluster you wish to connect to, then click Connect with MongoDB |compass|.

To access a cluster, you must connect from an IP address on the Atlas project's IP access list. If you need to add an IP address to the IP access list, you can do so in the Connect dialog. You can also add the IP address from the Network Access tab.

To access a cluster, you must create a database user with access to the desired database(s) on your Atlas cluster. Database users are separate from Atlas users. Database users have access to MongoDB databases, while Atlas users have access to the Atlas application itself.

You can create a database user to access to your Atlas cluster in the Connect dialog. You can also add the database user from the Clusters view.

Use the following procedure to connect MongoDB Compass 1.8 or later versions to your Atlas cluster.

1

In the Clusters view, click Connect for the cluster to which you want to connect.

2

Choose Connection Type from the set of available buttons.

Info With Circle IconCreated with Sketch.Note
Options Display if Feature Enabled

Atlas displays the connection type options after you enable Private IP for Peering, Private Endpoint, or both. If you haven't enabled either feature, no buttons display and Connection Type defaults to Standard.

Use this connection type for allowed public IP addresses.

3

Add a Connection IP Address

Important With Circle IconCreated with Sketch.Important

Skip this step if Atlas indicates in the Setup connection security step that you have already configured an IP access list entry in your cluster. To manage the IP access list, see Add Entries to the Access List.

Atlas allows standard client connections to the cluster from entries in the project's IP access list. The project IP access list differs from the API access list, which restricts API access to specific IP or CIDR addresses.

If the IP access list is empty, Atlas prompts you to add an IP address to the project's IP access list. You can either:

  • Click Add Your Current IP Address to allow access from your current IP address.
  • Click Add an IP Address to add a single IP address or a CIDR -notated range of addresses.

Provide an optional description for the newly added IP address or CIDR range. Click Add IP Address to add the address to the IP access list.

4
Important With Circle IconCreated with Sketch.Important

Skip this step if Atlas indicates in the Setup connection security step that you have at least one database user configured in your project. To manage existing database users, see Configure Database Users.

To access the cluster, you need a MongoDB user with access to the desired database or databases on the cluster in your project. If your project has no MongoDB users, Atlas prompts you to create a new user with the Atlas Admin role.

  1. Enter the new user's Username
  2. Enter a Password for this new user or click Autogenerate Secure Password.
  3. Click Create Database User to save the user.

Use this user to connect to your cluster in the following step.

Once you have added an IP address to your IP access list and added a database user, click Choose Your Connection Method.

5
  1. Click I have MongoDB Compass.
  2. Choose your version of MongoDB Compass in the dropdown. To check your version of MongoDB Compass, click About MongoDB Compass in the application.
  3. Copy the connection string presented in the Atlas Connect dialog.
6

MongoDB Compass automatically detects the URI connection string in the system clipboard and asks for permission to auto-fill the connection form with the appropriate information.

  1. Click Yes if you want to use the copied connection string.
  2. Fill in the Password field with the password for the user from the connection string.

    To connect with a different database user, update the Username and Password fields with the username and password of a different database user.

  3. (Optional) To save this connection for future use, fill in the Favorite Name field with a name for this connection. Click Create Favorite.

    Saved favorite connections appear in the left pane of the MongoDB Compass Connect window under Favorites.

  4. Click Connect.
Bulb IconTip
See Also:

To learn more about connecting to a database using MongoDB Compass, see the Connect Page in the MongoDB Compass documentation.

If you are experiencing issues connecting to your cluster, see Troubleshoot Connection Issues.

Give Feedback