Connect via mongo Shell

The Connect dialog for a cluster provides the details to connect to a cluster via the mongo shell.

  • For MongoDB 3.2 clusters, use the 3.2.6 or later version of the mongo shell with TLS/SSL support.
  • For MongoDB 3.4 clusters, use the 3.4.0 or later version of the mongo shell with TLS/SSL support.
  • For MongoDB 3.6 clusters, use the 3.6.0 or later version of the mongo shell with TLS/SSL support.



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 or M2/M5 shared starter cluster.

To access a cluster, you must connect from an IP address on the Atlas project’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


Open the Connect dialog.

Go to the Clusters view. Click the Connect button for the cluster to which you wish to connect.


From the Connect dialog, review the IP Whitelist.

Atlas only allows client connections to the cluster from entries in the project’s whitelist.

Atlas displays any entries already on the project whitelist in the Connect modal under Check the IP Whitelist. If you do not see the IP address of your client on the list, you can:

  • Click Add Entry to add a single IP address or a CIDR-notated range of addresses.

    For Atlas clusters deployed on Amazon Web Services and using VPC Peering, you can add a Security Group associated with the peer VPC.

  • Click Add Current IP Address to add your current IP address.

  • Click Allow Access From Anywhere to allow access from any IP address.


    Using Allow Access From Anywhere results in all clusters in the Atlas project being publically accessible. Consider the security risks of having public-facing MongoDB clusters before using this option.


Select Connect with the Mongo Shell.

The Connect dialog displays operating system-specific instructions for downloading the latest version of the mongo shell for the Atlas cluster, as well as the full command for connecting to the Atlas cluster with the mongo shell.

  1. Follow the instructions in the Connect dialog to download and install the latest version of the mongo shell.

  2. Select the connection string for your mongo shell version:

    • For version 3.6 or later, click I am using shell 3.6 or later.
    • For version 3.4 or earlier, click I am using shell 3.4 or earlier.

    To check which version of the mongo shell is installed on your system, run the following command from the terminal:

    mongo --version
  3. Copy and paste the connection string into a terminal or command line interface. Do not execute the command yet.

    The connection string includes the user name of a MongoDB user set up for the project for authentication purposes. Replace the <PASSWORD> placeholder with this user’s password. Once you have updated the PASSWORD, you can execute the command to connect to the Atlas cluster.

    To connect with a different MongoDB user, update the --username and --password parameters with the username and password of a different MongoDB user.