Auto assign floating IP

Posted August 5, 2016 4.7k views
DigitalOceanAPIDNSBackupsConfiguration ManagementDeployment

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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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.