Auto assign floating IP

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

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.