How to Delete Reserved IPs

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.


Deleting a reserved IP unassigns it and permanently removes it from your account.

Delete an Assigned IP Using Automation

How to Delete a Reserved IP Using the DigitalOcean CLI
  1. Install doctl, the DigitalOcean command-line tool.

  2. Create a personal access token and save it for use with doctl.

  3. Use the token to grant doctl access to your DigitalOcean account.

              doctl auth init
              
  4. Finally, run doctl compute reserved-ip delete. Basic usage looks like this, but you can read the usage docs for more details:

                doctl compute reserved-ip delete <reserved-ip> [flags]
              

    The following example deletes the reserved IP address 203.0.113.25:

                  doctl compute reserved-ip delete 203.0.113.25
                
How to Delete a Reserved IP Using the DigitalOcean API
  1. Create a personal access token and save it for use with the API.

  2. Send a DELETE request to https://api.digitalocean.com/v2/reserved_ips/{reserved_ip}

    cURL

    Using cURL:

                    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, the official DigitalOcean V2 API client for 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, the official DigitalOcean V2 API client for 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

                    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")
                  

Delete an Assigned IP Using the Control Panel

To delete a reserved IP from the control panel, click Networking in the main navigation, then click the Reserved IPs tab. Open the More menu of the reserved IP you want to delete, then click Delete.

Reserved IP with more menu open

In the confirmation window, click Delete Reserved IP to perform the deletion.