TemperStack
Intermediate8 min readUpdated Mar 18, 2026

How to set up floating IP addresses on DigitalOcean

Quick Answer

Floating IP addresses on DigitalOcean provide static IP addresses that can be reassigned between Droplets for high availability. You can create them through the Control Panel's Networking section and assign them to any Droplet in the same datacenter region.

Prerequisites

  1. Active DigitalOcean account with billing enabled
  2. At least one Droplet running in your account
  3. Basic understanding of IP networking concepts
  4. Access to DigitalOcean Control Panel
1

Access the Networking section

Log into your DigitalOcean Control Panel and navigate to Networking from the left sidebar menu. Click on the Floating IPs tab to access the floating IP management interface.
Tip
Floating IPs are region-specific, so make sure you're creating them in the same region as your target Droplet.
2

Create a new floating IP

Click the Create Floating IP button. Select the datacenter region where your Droplet is located from the Choose a datacenter region dropdown menu. The floating IP must be in the same region as the Droplet you want to assign it to.
Tip
Choose the region closest to your users for better performance and lower latency.
3

Assign the floating IP to a Droplet

In the Assign to Droplet section, select the Droplet you want to assign the floating IP to from the dropdown list. Only Droplets in the selected region will appear in this list. Click Create Floating IP to complete the creation process.
Tip
You can create an unassigned floating IP by leaving the Droplet field empty, then assign it later.
4

Configure the floating IP on your Droplet

SSH into your Droplet and configure the floating IP as a secondary IP address. For Ubuntu/Debian, edit /etc/netplan/50-cloud-init.yaml or use ip addr add FLOATING_IP/16 dev eth0. For CentOS/RHEL, edit /etc/sysconfig/network-scripts/ifcfg-eth0:0 with the floating IP configuration.
Tip
Always use /16 subnet mask for floating IPs on DigitalOcean's network infrastructure.
5

Test the floating IP connectivity

Verify the floating IP is working by pinging it from an external source: ping YOUR_FLOATING_IP. Test HTTP/HTTPS connectivity if you're running web services. Use curl -I http://YOUR_FLOATING_IP to test web server response.
Tip
Make sure your firewall rules allow traffic on the floating IP address.
6

Enable floating IP in application configuration

Update your application configurations, DNS records, and load balancer settings to use the floating IP address instead of the Droplet's original IP. Modify any hardcoded IP addresses in configuration files to reference the floating IP.
Tip
Update your DNS A records to point to the floating IP for seamless failover capabilities.
7

Set up automatic failover (optional)

Configure monitoring and automatic reassignment using DigitalOcean's API. Create scripts that can reassign the floating IP to backup Droplets using curl -X POST requests to the floating IP assignment endpoint. Implement health checks to trigger failover when needed.
Tip
Use DigitalOcean's API tokens for authentication when automating floating IP management.

Troubleshooting

Floating IP is not responding to ping or HTTP requests
Verify the floating IP is properly configured on the network interface with ip addr show. Check that your firewall (ufw/iptables) allows traffic on the floating IP. Ensure you're using the correct /16 subnet mask for the floating IP configuration.
Cannot assign floating IP to Droplet in different region
Floating IPs are region-locked and cannot be assigned across regions. Create a new floating IP in the target Droplet's region, or migrate your Droplet to the same region as the existing floating IP using DigitalOcean's snapshot and restore functionality.
Floating IP assignment fails with API errors
Verify your DigitalOcean account has sufficient permissions and billing is current. Check that the target Droplet is powered on and in a running state. Ensure the floating IP is not already assigned to another Droplet before attempting reassignment.
Network interface doesn't retain floating IP after reboot
Make the floating IP configuration persistent by adding it to your network configuration files. For systemd systems, use systemctl enable systemd-networkd. For Ubuntu, ensure the floating IP is properly configured in /etc/netplan/ files and run netplan apply.

Related Guides

More DigitalOcean Tutorials

Other Tool Tutorials

Ready to get started with DigitalOcean?

Put this tutorial into practice. Visit DigitalOcean and follow the steps above.

Visit DigitalOcean