Navigation

Connect via Compass

To connect MongoDB Compass to Atlas, you need:

  • The hostname of primary for a replica set or the hostname for the mongos for a sharded cluster.
  • The port of the primary for a replica set or the port for the mongos for a sharded cluster.
  • MongoDB User and Password. The connection details use the MongoDB administration user and password set up for the group. To connect with a different MongoDB user, replace the user name and password in the connection details.

The Connect dialog for a cluster provides connection string details. Use the displayed connection details to retrieve these details.

Prerequisites

  • TLS/SSL

    Clients must have support for TLS/SSL to connect to an Atlas cluster.

    Clients must have support for the SNI TLS extension to connect to an Atlas M0 Free Tier cluster.

  • Whitelist

    To access a cluster, you must connect from an IP address on the Atlas group’s IP whitelist. If you need to add an IP address to the whitelist, you can do so in the Connect dialog. You can also add the IP address from the Security tab.

Connect to Your Cluster

In Compass, to set up a New Connection to your Atlas cluster, enter the following information and click Connect.

Field Name Description
Hostname The hostname of primary for a replica set or the hostname for the mongos for a sharded cluster.
Port The port of the primary for a replica set or the port for the mongos for a sharded cluster.
Authentication Select Username / Password.
Username MongoDB user. The Atlas connection details displays the MongoDB administration user set up for the cluster. You can connect with a different MongoDB user.
Password Password associated with the specified MongoDB user.
Authentication Database Specify "admin".
SSL Select "Use System CA / Atlas Deployment"
SSH Tunnel Select "Off"
Favorite Name Enter a name for the connection if saving as a favorite.