DigitalOcean is a great VPS provider. I’ve used them to host this site for years. They are very reliable and professional. But the topic i’m going to discuss today isn’t concern most of DO customers. But there are still some who only use their droplets few days per month. And for those, following steps on this post will help save some bucks on the bill.
End up paying for full month fee to DigitalOcean. Although there is an easy option to turn on and off DigitalOcean droplets, turning off a droplet doesn’t help towards the bill because DigitalOcean is charging for the turned off droplets. And they should because you are still using space and resources even if your droplet is turned off.
So the solution is to take a snapshot of your droplet and destroy it. And when you need your droplet again, you can create a new one from the snapshot you created. Doing so will reduce the cost. But you’ll have to update DNS settings on your domain registrar each time you recreate your droplet because droplets come with random IP addresses. As a way around for this, you can allocate a static IP address to your account and assign it to new droplet whenever you create a new one. These are called Floating IPs in DigitalOcean. You can easily allocate an IP address to your account by going to Networking tab. Once there, click Floating IPs and assign a static IP address to your droplet.
Note that you need to have an active droplet to allocate a floating IP address for the first time. And it’ll stick to your account after that whether you have active droplets or not.
Assuming you already have successfully allocated and configured your setting to use new floating IP address, let’s start the process by creating a snapshot. You can take a live snapshot if you want. But I highly recommend shutting down your droplet before creating the snapshot. Run this command as root user to power off your droplet.
Now login to DigitalOcean and click the droplet name. You’ll see droplet management options on the left side menu. Click Snapshots and give your snapshot a friendly name. Then click big blue button to create the snapshot.
It can take few minutes to create the snapshot. Your droplet will be turned back on automatically after the snapshot. And when it’s done you can safely destroy your droplet. DigitalOcean will stop billing you for droplets now. But you’ll still be charged for snapshot storage and unassigned floating IP address which is far less than the droplet cost.
Now whenever you need to use your website you can launch a new droplet from the snapshot you created and; assign the floating IP address to your droplet. Nothing else needs to be changed. So let’s create a droplet from the snapshot. Just proceed as normal to create a new droplet. And then select Snapshots under Choose an image. You’ll see all your snapshots there. Choose the snapshot you created earlier and proceed with the droplet creation as you normally do.
Once the droplet is up and running, you need to assign the floating IP address you allocated to your account to the new droplet. You can do it by going to Networking > Floating IPs.
And that’s it. Hope this will help you save some bucks on your DigitalOcean bill. If you have issues or doubts about the method, please feel free to leave a comment below. I’ll get back to you.