Clients must have support for the SNI TLS extension to connect
to an Atlas M0 Free Tier or M2/M5 shared starter cluster.
The SNI TLS extension is
supported by version 3.4 of the mongo shell and
up.

Whitelist

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.

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.

Note

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:

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

Note

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.

This command applies only to the current shell session. Edit
the PATH environment variable in ~/.profile
to update the variable across shell sessions and reboots.

A copyable connection command appears in Step 3 of the
Atlas UI window. Be sure to update the
–username
option with your MongoDB username.

Copy and paste the mongo command and connection string into a
terminal and run it. The shell prompts you for the
–password
option.

The connection string includes the user name of a MongoDB user set
up for the project for authentication purposes. To connect as a
different MongoDB user, update the --username option with
the username of a different MongoDB user.

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

If your shell version is older than 3.4, MongoDB recommends that
you upgrade to the newest version.

A copyable connection command appears in Step 2 of the Atlas
UI window. Be sure to update the
–username
option with your MongoDB username.

Copy and paste the mongo command and connection string into a
terminal and run it.

For shell version 3.6 or later, the shell prompts you for the
–password
option.

For shell version 3.4 or earlier, the connection string includes the
--password option. Edit the placeholder value for the
option.

The connection string includes the user name of a MongoDB user set
up for the project for authentication purposes. To connect with a
different MongoDB user, update the
–username
option with the username of a different MongoDB user.