Floating IP failover is the reason a VPS can stay reachable even when the server behind it goes down. Instead of tying your public IP address to one machine, you keep a spare address that can move to a healthy server in seconds. When the main server fails, the address shifts, traffic follows, and visitors keep reaching your site.
That movement is the whole point. A normal public IP belongs to one server, so if that server crashes, the address goes dark with it. A floating IP is separate from any single machine. Your cloud provider or your own routing setup decides which server currently holds it, and that decision can change fast. For a small business site, a client project, or any service where downtime costs trust, that difference matters.
What a floating IP actually is
A floating IP is an extra public IP address that is not fixed to one server. You assign it to a VPS, and later you can reassign it to a different VPS, usually through your provider dashboard or API. The address itself never changes, so DNS records, firewall rules, and bookmarks keep working. Only the machine behind the address changes.
Think of it like a shop sign that can hang above a different door. Customers always look for the same sign. If one shop closes for repairs, the sign moves to the backup shop across the street, and customers still find you.
Unlike a private IP, which only works inside a private network, a floating IP is public and portable by design.
How floating IP failover works
A typical setup has two servers: a primary and a standby. Both run the same site or service, with data kept in sync by replication, shared storage, or regular backups. A health check watches the primary server, often by pinging it or requesting a test page every few seconds. If the checks fail for a set number of tries, the failover logic kicks in.
At that point, the floating IP is reassigned to the standby server. The standby already has the site files and a web server ready, so it starts answering requests at the same address almost at once. Visitors may see a brief pause, but they do not need a new address, and DNS does not need to change. That is why failover through a floating IP is usually faster than waiting for DNS changes to spread, which can take minutes or longer. If you want the broader picture of how traffic gets spread across healthy servers, read the guide to how a load balancer distributes traffic.
Some setups use a small script on the standby server that runs the reassignment through the provider API. Others use a cluster tool such as Keepalived, which handles the move at the network level. Either way, the moving parts are the same: a health check, a decision rule, and a way to move the address.
Floating IP vs static IP
A static IP is simple and predictable. It belongs to one server, it rarely changes, and it works well for a single machine that does not need a backup. The weakness shows up during an outage: the address cannot move, so recovery means fixing the same server or updating DNS and waiting.
A floating IP adds a layer of work. You need a second server, a way to keep data in sync, and a health check you trust. In return, you get recovery measured in seconds rather than minutes, with no DNS wait. For a hobby project, that extra work may not pay off. For a store, a booking page, or a client site that brings in leads, it often does.
There is also a middle path. Some teams keep a static IP on the main server and hold a floating IP only for planned moves, such as switching providers or replacing a machine. That pattern pairs well with a zero-downtime VPS migration plan, where the address moves once the new server is tested and ready.
When a floating IP helps, and when it does not
A floating IP helps most when the service is stateless or when data sync is simple: a marketing site, a docs site, a landing page, or an app that stores its data in a separate managed database. A simple vps failover setup like this suits teams that want high availability vps behavior without running a full load balancer cluster.
It helps less when the app keeps important state on local disk and that state changes every second. If orders, uploads, or session files live only on the primary server, moving the address does not move the data. You would need replication or shared storage first, or the standby will serve a stale copy. Fix the data problem before you add failover, or the failover will only move the outage to a second machine.
It also does not protect against every failure. If both servers sit in the same data center and that data center loses power, both go down together. If your database is the single point of failure, moving the web address will not bring the database back. Failover covers server failure well. It does not replace backups, and it does not replace a plan for the rest of the stack. For private links between servers, a separate WireGuard VPN on your own VPS keeps replication traffic off the public internet.
Setting up floating IP failover on a VPS
The exact steps depend on your provider, but the shape is the same everywhere. First, create the floating IP in your provider panel and assign it to the primary server. Point your domain at the floating IP, not at the server’s built-in address, so the address is the one visitors use.
Second, build the standby server with the same software: the same web server, the same site files, and the same TLS certificates. Automate this with a script or a config tool if you can, because a standby that drifts out of date is a standby that fails when called on.
Third, set up data sync. For a static site, a scheduled file copy may be enough. For a dynamic app, use database replication or move the database to a managed service so both servers read from one source. Test that a change on the primary shows up on the standby.
Fourth, add health checks and the move logic. Keep the check simple: a request to a health page that returns success only when the app and its database both answer. Set the failure threshold high enough to survive a brief restart, but low enough that a real outage triggers a move within a minute or two. A check that fires on every small blip will flap the address back and forth and confuse visitors.
Fifth, make the standby take over cleanly. It should already run the web server, already hold valid certificates, and already accept traffic on the floating IP. The move itself should be the only change at failover time, not the moment you discover a missing config file.
Common mistakes that break failover
The most common mistake is never testing the move. A setup that has never failed over in practice is a guess, not a safety net. Test it in a maintenance window, watch what breaks, and fix those gaps before a real outage finds them.
The second mistake is syncing files but not certificates or cron jobs. A standby that serves an expired certificate, or that misses a scheduled task, looks broken even when the web server runs fine. Keep a checklist of everything the primary does, and confirm the standby does the same.
The third mistake is a health check that only pings the server. A machine can answer pings while its web server is down or its database is stuck. Check the actual service, not just the machine. DNS caching can also surprise you: if visitors still reach the old address through a cached record, check how your records work by reading how anycast DNS speeds up site loading and confirming your TTL values suit a failover plan.
Test failover before you need it
Run a planned test every few months. Stop the web server on the primary, confirm the address moves, confirm the standby answers, then move back and confirm again. Note how long each step takes and what you had to fix by hand. That note becomes your runbook for the night a real failure wakes you up.
A floating IP will not make a weak setup strong, but it gives a solid setup a fast way to survive a dead server. Pair it with synced data, honest health checks, and a tested move, and a single server failure becomes a short blip instead of an outage.