How to Use a BYOIP Address with a Load Balancer
Last verified 3 Sep 2026
DigitalOcean fully manages Regional Load Balancers and Global Load Balancers, ensuring they are highly available load balancing services. Load balancers distribute traffic to groups of backend resources in specific regions or across different regions, which prevents the health of a service from depending on the health of a single server, cluster, or region.
When you create an external regional load balancer, you can assign an IP address from one of your Bring Your Own IP (BYOIP) prefixes instead of receiving a randomly assigned DigitalOcean IP address. This lets the load balancer keep an address you already own and control.
You can only set a BYOIP address when you create the load balancer. You cannot change the address afterward, and you cannot use BYOIP with global or internal load balancers.
Prerequisites
- An Active, advertised BYOIP prefix in the same region as the load balancer you want to create. To bring a prefix to DigitalOcean, see How to Provision a BYOIP Prefix.
- An unassigned IP address from that prefix. The first and second IP addresses of a BYOIP subnet are reserved and cannot be assigned.
Use a BYOIP Address Using the CLI
To assign a BYOIP address when you create a load balancer using doctl version v1.165.0 or higher, pass the address to the --ip flag of the doctl compute load-balancer create command:
doctl compute load-balancer create \
--name example-load-balancer \
--region nyc3 \
--forwarding-rules entry_protocol:http,entry_port:80,target_protocol:http,target_port:80 \
--ip <your-byoip-address>Replace <your-byoip-address> with an unassigned address from one of your BYOIP prefixes in the same region as the load balancer. The --ip flag is create-only, so omit it when you update a load balancer. Omit the flag entirely to receive a randomly assigned DigitalOcean IP address.
To confirm the assignment, get the load balancer and check that its IP address matches the address you provided:
doctl compute load-balancer get <load-balancer-id>Use a BYOIP Address Using the API
To assign a BYOIP address through the API, include the ip field in your load balancer create request. The following example payload creates a load balancer that uses a BYOIP address:
{
"name": "example-load-balancer",
"region": "nyc3",
"ip": "<your-byoip-address>",
"forwarding_rules": [
{
"entry_protocol": "http",
"entry_port": 80,
"target_protocol": "http",
"target_port": 80
}
]
}Replace <your-byoip-address> with an unassigned address from one of your BYOIP prefixes in the same region as the load balancer. The ip field is create-only. Omit it to receive a randomly assigned DigitalOcean IP address.
Use a BYOIP Address Using the Control Panel
Follow the standard load balancer creation flow in How to Create Regional Load Balancers. On the Create Load Balancer page, choose Regional as the type and External as the network visibility so that the IP Address section appears.
In the IP Address section, do the following:
-
Select Bring your own IP (BYOIP). The default option is Randomly assigned, which provisions a new DigitalOcean IP address automatically.
-
From Select a BYOIP prefix, choose one of your BYOIP prefixes. Only Active prefixes in the load balancer’s region appear. If none are available, the form displays No active BYOIP prefixes are available in this region.
-
In the IP address field, enter an unassigned address from the selected prefix, such as
203.0.113.42.
Complete the rest of the form, then click Create Load Balancer. The load balancer provisions with the BYOIP address you selected.