All Products
Search
Document Center

Elastic Compute Service:Assign and manage static public IP addresses

Last Updated:May 15, 2026

Assign, change, or release a static public IP address. Use an EIP instead for persistent addresses.

Assign a static public IP

Assign a public IP when you create an instance

ECS Console

  • Quick launch:

    1. On the ECS - quick launch page, in the Public Bandwidth section, select Assign Public IPv4 Address.

    2. Set the billing method:

      • Pay-by-bandwidth: Charged by provisioned bandwidth. Suitable for stable traffic.

      • Pay-by-traffic: Charged by outbound data transfer. Suitable for fluctuating traffic.

  • Custom launch:

    1. On the ECS console - custom launch page, in the Public IP Address section, select Assign Public IPv4 Address.

    2. Set the Bandwidth Billing Method:

      • Pay-by-bandwidth/Bandwidth: Charged by provisioned bandwidth. Suitable for stable traffic.

      • Pay-by-traffic/Maximum Bandwidth: Charged by outbound data transfer. Suitable for fluctuating traffic.

API

Call RunInstances with InternetMaxBandwidthOut set to a value greater than 0 Mbps.

Assign a public IP to an existing instance

ECS Console

  1. Go to ECS console - Instances. Click the target instance ID to open its details page.

  2. In the All Actions section, select Change Pay-as-you-go Instance Bandwidth or Change Subscription Instance Bandwidth.

  3. Set the Bandwidth Billing Method:

    • Pay-by-traffic: Charged by outbound data transfer. Suitable for fluctuating traffic.

    • Pay-by-bandwidth: Charged by provisioned bandwidth. Suitable for stable traffic.

  4. Set Bandwidth (or Maximum Bandwidth) to a value greater than 0 Mbps. The system assigns a static public IP address to the instance.

API

Call ModifyInstanceSpec with InternetMaxBandwidthOut set to a value greater than 0 Mbps.

Change a static public IP address

Important

If the static public IP address is configured in your applications, whitelists for cloud services (such as databases or cache services), or system configuration files (such as /etc/hosts), update all related configurations after changing the IP address to avoid service disruptions.

Within 6 hours after the instance creation

If you have changed the public IP address more than three times within 6 hours after instance creation, use the method in More than 6 hours after the instance creation.
  1. Go to ECS console - Instances. Click the target instance ID to open its details page.

  2. In the All Actions section, choose Instance Status > Stop. In the dialog box, select Standard Mode as the stop mode.

    If you select economical mode, the public IP address is reclaimed and the change cannot be performed.
  3. In the All Actions section, choose Network and Security Group > Change Public IP Address.

    A dialog box displays the new static public IP address after the change.

More than 6 hours after the instance creation

A static public IP address is bound to its instance. To change it, convert it to an EIP, unbind it, and then assign a new static public IP.

Important
  1. Convert the static public IP address to an EIP.

  2. Disassociate the EIP from the instance.

  3. Set the maximum public bandwidth to a value greater than 0 Mbps. The system assigns a new static public IP address.

  4. Release the EIP to avoid EIP configuration fees.

Release and reclaim a static public IP address

The system automatically reclaims a static public IP address in the following situations. Reclaimed addresses cannot be recovered.

  • Bandwidth set to 0: The public IP address is reclaimed when bandwidth is set to 0 Mbps.

  • Economical mode stop: For a pay-as-you-go instance, the public IP address is reclaimed if you stop the instance in economical mode.

  • Instance release: The bound public IP address is reclaimed when the instance is released.

Billing

Static public IP addresses incur no holding fees. You pay only for outbound public bandwidth. See Bandwidth billing.

FAQ

Can I resolve high latency when accessing an ECS instance in an overseas region from the Chinese mainland by changing its public IP address?

No. Traffic to overseas instances from the Chinese mainland traverses international carrier routes, which can cause instability due to link congestion and routing limitations. Use an instance in the Chinese mainland or use Global Accelerator.

Can I specify a particular IP address when assigning or changing a static public IP address?

No. The system randomly assigns an available IP address.

References

Use an Elastic IP Address (EIP) for production workloads that require a persistent, manageable IP address.