All Products
Search
Document Center

ApsaraDB for MongoDB:Manage public endpoints

Last Updated:Jun 02, 2026

Apply for or release public endpoints to connect to your ApsaraDB for MongoDB instance over the internet.

Connection types

ApsaraDB for MongoDB instances provide a private endpoint within a VPC by default. To connect over the internet, apply for a public endpoint.

Endpoint type

Description

Private endpoint (VPC)

  • A VPC is an isolated network that provides higher security and performance than a classic network.

  • ApsaraDB for MongoDB provides a VPC endpoint by default.

Public endpoint

  • Only VPC endpoints are provided by default due to internet security risks.

  • To connect from outside Alibaba Cloud, such as an on-premises device, apply for a public endpoint.

Apply for a public endpoint

Usage notes

  • For cloud disk instances, applying for a public endpoint may cause a transient disruption to existing connections. Perform this during off-peak hours and ensure your application supports reconnection.

  • Before connecting over a public endpoint, add your client's public IP address to the whitelist.

  • For sharded cluster instances on cloud disks, public endpoints can only be applied for Mongos nodes.

Procedure

  1. Navigate to the MongoDB replica set instances page or the MongoDB sharded cluster instances page. Select a resource group and a region in the top navigation bar, and then click the ID of the target instance.

  2. In the left-side navigation pane, click Database Connections.

  3. Follow the steps for your instance type.

    Replica set/standalone instance

    1. In the Public Connections section, click Apply for Public Endpoint.

    2. In the Apply for Public Endpoint dialog box, click OK.

    Sharded cluster

    1. In the Public Connections section, click Apply for Public Endpoint.

    2. In the Apply for Public Endpoint panel, configure the following parameters.

      Parameter

      Option

      Description

      Node type

      Shard

      The Shard component.

      Note
      • A public endpoint for a Shard node is typically used to read oplog data over the internet, such as for cross-cluster data synchronization.

      • Before applying for a public endpoint, apply for a Shard endpoint first.

      CS

      The ConfigServer component.

      Note

      Public endpoints for ConfigServer are available only for instances that already have a private ConfigServer endpoint. New private ConfigServer endpoints are no longer supported.

      Mongos

      The Mongos component.

      Most read and write operations require only a Mongos connection.

      Node ID

      The ID of a node in the current instance.

      Select the target node.

    3. Click OK.

    To apply for public endpoints for other nodes in the sharded cluster instance, repeat these steps.

Release a public endpoint

Usage notes

  • After you release a public endpoint, the endpoint becomes unavailable for connections.

  • After releasing a public endpoint, remove the corresponding public IP address from the whitelist for security.

Procedure

  1. Navigate to the MongoDB replica set instances page or the MongoDB sharded cluster instances page. Select a resource group and a region in the top navigation bar, and then click the ID of the target instance.

  2. In the left-side navigation pane, click Database Connections.

  3. Follow the steps for your instance type.

    Replica set/standalone instance

    Note

    Releasing a replica set instance's public endpoint also releases the endpoints for its primary and secondary nodes.

    1. In the Public Connections section, click Release Public Endpoint.

    2. In the Release Public Endpoint dialog box, click OK.

    Sharded cluster

    Note
    • You can release public endpoints for individual Mongos, Shard, or ConfigServer components. Unreleased endpoints remain accessible. Sharded cluster architecture.

    • Releasing a Shard or ConfigServer endpoint also releases the endpoints for its primary and secondary nodes.

    1. In the Public Connections section, find the endpoint that you want to release, and then click Release in the Actions column.

    2. In the Release Public Endpoint dialog box, click OK.

    To release the public endpoints for other nodes in the sharded cluster instance, repeat these steps.

FAQ

Q: Does applying for a public endpoint incur fees? Is public network bandwidth limited?

A: ApsaraDB for MongoDB instances do not have a public endpoint by default. Apply for one to enable internet access.

  • Billing: Public endpoints are currently free. Inbound and outbound public network traffic is also free of charge.

  • Bandwidth: No bandwidth limit is imposed on public network access. Actual speed depends on instance performance and network conditions.

Related topics