For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).
How to Assign BYOIP IPs
Last verified 9 Jun 2026
DigitalOcean Reserved IPs are publicly-accessible static IPv4 and IPv6 addresses. Assign and reassign reserved IP addresses to Droplets as needed, or implement an automated failover mechanism with reserved IPs to build a high availability infrastructure.
Assign a BYOIP IP Address Using Automation
Use the standard reserved IP assign actions to assign BYOIP IP addresses. Substitute a valid address from your prefix for any <reserved-ip> placeholders. The first and second IP address of the BYOIP subnet are reserved.
How to Assign a BYOIP Address Using the DigitalOcean CLI
# Assign a Reserved IP to a Dropletcurl -X POST \
-H "Content-Type: application/json"\
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN"\
-d '{"type":"assign","droplet_id":8219222}'\
"https://api.digitalocean.com/v2/reserved_ips/45.55.96.47/actions"# Unassign a Reserved IP# curl -X POST \ -H "Content-Type: application/json"\
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN"\
-d '{"type":"unassign"}'\
"https://api.digitalocean.com/v2/reserved_ips/45.55.96.47/actions"
Go
Using Godo, the official DigitalOcean API client for Go:
import("context""os""github.com/digitalocean/godo")funcmain(){token:=os.Getenv("DIGITALOCEAN_TOKEN")client:=godo.NewFromToken(token)ctx:=context.TODO()// Assign a Reserved IP to a Dropletaction,_,err:=client.ReservedIPActions.Assign(ctx,"45.55.96.47",8219222)// Unassign a Reserved IPaction,_,err:=client.ReservedIPActions.Unassign(ctx,"45.55.96.47")}
Ruby
Using DropletKit, the official DigitalOcean API client for Ruby:
require'droplet_kit'token=ENV['DIGITALOCEAN_TOKEN']client=DropletKit::Client.new(access_token:token)# Assign a Reserved IP to a Dropletclient.reserved_ip_actions.assign(ip:'45.55.96.47',droplet_id:8219222)# Unassign a Reserved IP# client.reserved_ip_actions.unassign(ip: '45.55.96.47')
Python
Using PyDo, the official DigitalOcean API client for Python:
To assign a BYOIP IP address from the Control Panel, click Networking in the main menu, then click Reserved IPs to see a list of your reserved IPs and BYOIP prefixes.
Find the prefix you’d like to use, and then click Assign to Droplet to open the Assign window.
In the Assign window, type a valid IP address from the prefix, and then select the Droplet to assign it to. The first and second IP address of the BYOIP subnet are reserved.
Afterwards, click Assign IP Address to complete the process.
We can't find any results for your search.
Try using different keywords or simplifying your search terms.