Connect to a 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.
MongoDB User

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

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

Open Ports 27015 to 27017 to Access Atlas Databases

If you use a whitelist on your firewall for network ports, open ports 27015 to 27017 to TCP and UDP traffic on Atlas hosts. This grants your applications access to databases stored on Atlas.

To configure your application-side networks to accept Atlas traffic, we recommend using the Atlas API Get All Clusters endpoint to retrieve mongoURI from the response elements. You can also use the Get All MongoDB Processes endpoint to retrieve cluster hostnames (, etc).

You can parse these hostname values and feed the IP addresses programatically into your application-tier orchestration automation to push firewall updates.

Use the Connect dialog to 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.


Whitelist your connection IP address.

Atlas only allows client connections to the cluster from entries in the project’s whitelist. The project whitelist is distinct from the API whitelist, which restricts API access to specific IP or CIDR addresses.


You can skip this step if Atlas indicates in the Setup Connection Security step that you have already configured a whitelist entry in your cluster. To manage the IP whitelist, see Add Entries to the Whitelist.

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

  • Click Add Your Current IP Address to whitelist your current IP address.

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

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

You can provide an optional description for the newly added IP address or CIDR range. Click Add IP Address to add the address to the whitelist.


Create a MongoDB User.

To access the cluster, you must create a MongoDB user with access to the desired database(s) on the cluster.


You can skip this step if Atlas indicates in the Setup Connection Security step that you have at least one MongoDB user configured in your project. To manage existing MongoDB users, see Add MongoDB Users.

If the project has no MongoDB users, Atlas prompts you to create a new user with the Atlas Admin privilege. Enter the new user’s Username and Password and click Create MongoDB User to save the user. Use this user to connect to your cluster in the following step.

Once you have whitelisted an IP address and added a MongoDB user, click Choose Your Connection Method.


Select your preferred connection method.

In the Choose a connection method step, Atlas provides instructions for each listed connection method. Click your preferred connection method and follow the instructions given.

For connecting via a command line tool such as mongodump or mongorestore, use the Command Line Tools tab for an auto-generated template for connecting to your Atlas cluster with your preferred tool.


Atlas does not guarantee that host names remain consistent with respect to node types during topology changes.


If you have a cluster named foo123 containing an analytics node, Atlas does not guarantee that specific host name will continue to refer to an analytics node after a topology change, such as scaling a cluster to modify its number of nodes or regions.