Auto assign floating IP

August 5, 2016 3.5k views
Backups DNS Configuration Management API Deployment DigitalOcean

I sometimes run a game server for my friends and I to use, but it’s not on most of the time so I usually snapshot it and destroy it, and restore the snapshot a few days later when we play again. I was wondering if there’s a way to automatically assign my floating IP to the one server I have when it’s created.

1 Answer


As of right now, there isn’t a simple way to do it through the control panel, other than manually attaching the IP after the Droplet is created. However, you can use the API to do that. Here’s a rough outline of how it would work:

  1. create a new Droplet and store its ID
  2. check its status every few seconds and wait until it’s Active
  3. finally, attach your Floating IP to the Droplet.
Have another answer? Share your knowledge.