# How to Delete Reserved IPs 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. Deleting a reserved IP unassigns it and permanently removes it from your account. ## Delete an Assigned IP Using Automation ## How to Delete a Reserved IPv4 Using the DigitalOcean CLI 1. [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI. 2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`. 3. Use the token to grant `doctl` access to your DigitalOcean account. ```shell doctl auth init ``` 4. Finally, run `doctl compute reserved-ip delete`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/compute/reserved-ip/delete/index.html.md) for more details: ```shell doctl compute reserved-ip delete [flags] ``` The following example deletes the reserved IP address `203.0.113.25`: ```shell doctl compute reserved-ip delete 203.0.113.25 ``` ## How to Delete a Reserved IPv4 Using the DigitalOcean API 1. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API. 2. Send a DELETE request to [`https://api.digitalocean.com/v2/reserved_ips/{reserved_ip}`](https://docs.digitalocean.com/reference/api/reference/reserved-ips/index.html.md#reservedIPs_delete). ### cURL Using cURL: ```shell curl -X DELETE \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/reserved_ips/45.55.96.47" ``` ### Go Using [Godo](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go: ```go import ( "context" "os" "github.com/digitalocean/godo" ) func main() { token := os.Getenv("DIGITALOCEAN_TOKEN") client := godo.NewFromToken(token) ctx := context.TODO() _, err := client.ReservedIPs.Delete(ctx, "45.55.96.34") } ``` ### Ruby Using [DropletKit](https://github.com/digitalocean/droplet_kit), the official DigitalOcean API client for Ruby: ```ruby require 'droplet_kit' token = ENV['DIGITALOCEAN_TOKEN'] client = DropletKit::Client.new(access_token: token) client.reserved_ips.delete(ip: '45.55.96.47') ``` ### Python Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python: ```python import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.reserved_ips.delete(reserved_ip="45.55.96.47") ``` ## How to Delete a Reserved IPv6 Using the DigitalOcean CLI 1. [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI. 2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`. 3. Use the token to grant `doctl` access to your DigitalOcean account. ```shell doctl auth init ``` 4. Finally, run `doctl compute reserved-ipv6 delete`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/compute/reserved-ipv6/delete/index.html.md) for more details: ```shell doctl compute reserved-ipv6 delete [flags] ``` The following example deletes the reserved IPv6 address `5a11:a:b0a7`: ```shell doctl compute reserved-ipv6 delete 5a11:a:b0a7 ``` ## How to Delete a Reserved IPv6 Using the DigitalOcean API 1. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API. 2. Send a DELETE request to [`https://api.digitalocean.com/v2/reserved_ipv6/{reserved_ipv6}`](https://docs.digitalocean.com/reference/api/reference/reserved-ipv6/index.html.md#reservedIPv6_delete). ### cURL Using cURL: ```shell curl -X DELETE \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/reserved_ipv6/2409:40d0:f7:1017:74b4:3a96:105e:4c6e" ``` ### Go Using [Godo](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go: ```go import ( "context" "os" "github.com/digitalocean/godo" ) func main() { token := os.Getenv("DIGITALOCEAN_TOKEN") client := godo.NewFromToken(token) ctx := context.TODO() _, err := client.ReservedIPV6s.Delete(ctx, "2409:40d0:f7:1017:74b4:3a96:105e:4c6e") } ``` ### Python Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python: ```python import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.reserved_ipv6s.delete(reserved_ipv6="2409:40d0:f7:1017:74b4:3a96:105e:4c6e") ``` ## Delete an Assigned IP Using the Control Panel To delete a reserved IP from the [control panel](https://cloud.digitalocean.com), click **Networking** in the main menu, then click the **Reserved IPs** tab. Open the **More** menu of the reserved IP you want to delete, then click **Delete**. ![Reserved IPs page listing IP addresses with associated Droplets and a More dropdown menu offering reassign, unassign, and delete options.](https://docs.digitalocean.com/screenshots/reserved-ips/assign-reserved-ip.e365e5a632472195d6c8a090d17fe4f959e2f0f21477a0a99574174560ffc3e0.png) In the confirmation window, click **Delete Reserved IP** to perform the deletion.