Validated on 8 Nov 2019 • Last edited on 8 Jul 2024
ip
DigitalOcean Reserved IP addresses are a publicly-accessible static IP addresses. Assign and reassign reserved IP addresses to Droplets as needed, or implement a failover mechanism with reserved IPs to build a high availability infrastructure.
Create a Reserved IP Using the CLI
The Reserved IP creation command requires you to assign the IP address to a Droplet upon creation using the Droplet’s ID. You can retrieve a list of Droplets and their IDs using the doctl compute droplet list command.
How to Create a Reserved IP Using the DigitalOcean CLI
The Reserved IP creation call requires you to assign the IP address to a Droplet upon creation using the Droplet’s ID. You can retrieve a list of Droplets and their IDs using the /v2/droplets endpoint.
How to Create a Reserved IP Using the DigitalOcean API
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"droplet_id": 2457247
}
resp = client.reserved_ips.create(body=req)
Create a Reserved IP Using the Control Panel
To create a reserved IP from the control panel, click Create in the top right, then click Reserved IP.
This takes you to the Reserved IPs page. When you have no reserved IPs, this page invites you to choose a Droplet and assign one.
To reserve and assign a reserved IP to one of your Droplets, locate the Droplet using the Search for a Droplet text box, then click Assign Reserved IP.
Once you have at least one address assigned, you can reserve additional reserved IP addresses in specific datacenters without assigning them to Droplets by following the click here link in the header text.