All Products
Search
Document Center

ApsaraDB for MongoDB:Configure an IP address whitelist

Last Updated:Feb 28, 2026

After creating an ApsaraDB for MongoDB instance, configure an IP address whitelist or a security group for the instance to allow external devices to connect. By default, the whitelist contains only 127.0.0.1, which blocks all external access. This topic describes how to configure an IP address whitelist.

Prerequisites

Important

The instance endpoints appear on the Basic Information and Database Connections pages only after you configure a whitelist. You must configure the whitelist before first use.

  • An ApsaraDB for MongoDB instance

  • The instance ID and the region where the instance resides

Usage notes

Procedure

  1. Go to the Replica Set Instances or Sharded Cluster Instances page.

  2. In the top navigation bar, select the region and resource group of your instance. Then, click the instance ID.

  3. In the left-side navigation pane, choose Data Security > Whitelist Settings.

  4. Click Create Whitelist.

  5. In the Create Whitelist panel, configure the following settings:

    1. Enter a whitelist name.

      The name must be 2 to 32 characters in length, start with a lowercase letter, end with a lowercase letter or digit, and contain only lowercase letters, digits, and underscores (_).

    2. Select the IPv4 or IPv6 tab based on the IP address type.

      Note

      IPv6 is supported only by instances that run MongoDB 4.2.

    3. In the IP Whitelist field, add IP addresses.

      Separate multiple entries with commas (,). A maximum of 1,000 entries can be added per whitelist.

      IP version

      Supported formats

      Example

      IPv4

      Individual IP addresses

      10.23.12.24

      IPv4

      CIDR blocks (prefix length: 1 to 32)

      10.23.12.24/24

      IPv6

      Individual IP addresses

      --

      Warning

      If the whitelist contains only 0.0.0.0/0 or is empty, all IP addresses can access the instance. This poses a security risk. Proceed with caution.

  6. Click OK.

Related topics

Delete an IP address whitelist