How to Rebuild Droplets

Rebuilding a Droplet wipes the Droplet’s disk and replaces it with an image you select. This is an option if you’re concerned that your Droplet has compromised, you’ve lost access to it, you’d like to switch operating systems, or other situations where you’d like to complete replace the contents of a Droplet.

In some scenarios, it’s simpler to destroy the current Droplet and create a new one, but rebuilding is a better choice in two scenarios:

  1. You want to keep your IP address. When you destroy a Droplet, its IP address is released back into the datacenter’s pool of available IPs. These are assigned randomly, so it’s very unlikely you’ll get that IP address back. When you rebuild a Droplet, on the other hand, the IP address is retained.

  2. You want to spend less. DigitalOcean charges by the hour and only charges for the first 672 hours (28 days) in each month. That means if your Droplet has existed all month, you get up to 3 days at the end of the month free. If you destroy your Droplet and create a new one, that timer restarts. If you rebuild it, that timer continues to count up toward the free time at the end of the month.

Rebuilding a Droplet, like destroying a Droplet, is an irreversible process. If you have no backups, snapshots, or local copies of the data on your Droplet and you rebuild it, that data is completely irretrievable by DigitalOcean.

Rebuilding a Droplet

From the DigitalOcean Control Panel, on the Droplets page, click the name of the Droplet you want to rebuild to open the Droplet’s detail page. From there, open the Destroy tab on the left.

Droplet Destroy & Rebuild Tab

In the Rebuild Droplet section, click on the Select an image text box and search for the image you’d like to use. You can use any image in your account, including backups, snapshots, custom images, One-Click application images, and base OS distributions we provide.

At this time, rebuilding a Droplet to a different base OS distribution can cause issues and is not recommended. Instead, you should create a new Droplet using your chosen distribution and migrate to it.

Image Selection Dropdown

Once you’ve selected the image you’d like to use, the Rebuild button will turn blue. Click it to begin rebuilding the Droplet. The rebuild should take roughly the same amount of time as creating a new Droplet from that image. When it’s complete, you’ll have a clean Droplet with the new image.

Once the Droplet has been rebuilt, it will have a new fingerprint, also known as a remote host identification key. Because local SSH clients store the fingerprints of the servers they connect to, you may see a warning about the differing fingerprint when you reconnect to the rebuilt Droplet:

  
    
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:RqX4d+VC6sBaOSMEo8JgyjpvmoQTQY4E6EYe7vCQV5c.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:3
  remove with:
  ssh-keygen -f "/root/.ssh/known_hosts" -R 203.0.113.47
ECDSA host key for 203.0.113.47 has changed and you have requested strict checking.
Host key verification failed.

  

To resolve this, run the command from the warning message:

ssh-keygen -f "/root/.ssh/known_hosts" -R use_your_droplet_ip

This removes the old key, which will let you connect to the Droplet as normal without seeing the warning.