Join us at MongoDB.local London on 7 May to unlock new possibilities for your data. Use WEB50 to save 50%.
Register now >
Docs Menu
Docs Home
/

Connect to an Atlas Cluster

This page describes how to connect to your Atlas cluster using the Atlas CLI or the Atlas UI.

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 box. 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 databases 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 your Atlas cluster in the Connect dialog box. You can also add the database user from the Cluster view.

Make sure your application can reach your MongoDB Atlas environment. To add the inbound network access from your application environment to Atlas, do one of the following:

  1. Add the public IP addresses to your IP access list

  2. Use VPC / VNet peering to add private IP addresses.

  3. Add private endpoints.

Tip

If your firewall blocks outbound network connections, you must also open outbound access from your application environment to Atlas. You must configure your firewall to allow your applications to make outbound connections to ports 27015 to 27017 to TCP traffic on the hostnames or IP addresses of your cluster. This grants your applications access to databases stored on Atlas.

To obtain the current list of cluster IP addresses, use the Return All IP Addresses for One Project endpoint of the Atlas Administration API.

curl --header "Authorization: Bearer <access-token>" \
--header "Accept: application/vnd.atlas.2025-03-12+json" \
--request GET \
"https://cloud.mongodb.com/api/atlas/v2/groups/{GROUP-ID}/ipAddresses"

Note

By default, MongoDB Atlas clusters do not need to be able to initiate connections to your application environments. If you wish to enable Atlas clusters with LDAP authentication and authorization, you must allow network access from Atlas clusters directly to your secure LDAP. You can allow access to your LDAP by using public or private IPs as long as a public DNS hostname points to an IP that the Atlas clusters can access.

If you are not using VPC / VNet peering and plan to connect to Atlas using public IP addresses, see the following pages for additional information:

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

Example

If you have a cluster named foo123 containing an analytics node foo123-shard-00-03-a1b2c.mongodb.net:27017, 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.

To get your deployment's connection string, you can use the Atlas CLI or Atlas UI:

In order to connect to your cluster, you must get your deployment's Connection Strings. Once you have the connection string, you can connect to your deployment by using the following connection methods:

Note

To connect using mongodump or mongorestore, use the Command Line Tools option in the Cluster sidebar. This creates an auto-generated template for connecting to your Atlas cluster with your preferred tool.

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

Back

Formats

On this page