We hope you find this tutorial helpful. In addition to guides like this one, we provide simple cloud infrastructure for developers. Learn more →

An Introduction to DigitalOcean Backups

UpdatedJanuary 26, 2018 3.3k views DigitalOcean Product Documentation

Introduction

Backups are an important consideration for any hosted system and should provide an easy and reliable method for recovering files in case of a mistaken file deletion or total system catastrophe. DigitalOcean provides a built-in backup system that can be enabled on any of your Droplets.

When Should I Use Backups?

Droplet backups are a convenient way to back up the disk contents of your Droplets, with no configuration required. They can be enabled for any Droplet, but may not be ideal for Droplets with a heavy I/O workload — such as database servers — because disk writes will have degraded performance while the backup snapshot is being created. Backups are taken once weekly for each Droplet where they're enabled and are retained for four weeks.

If you're looking for a one-time snapshot of your Droplet instead of an ongoing backup, then using a Snapshot may be more appropriate and cost effective. You can visit DigitalOcean Backups and Snapshots Explained to learn about the differences between backups and snapshots. If you require a more fine-grained backup solution, you can read about other options at How To Choose an Effective Backup Strategy for your VPS.

DigitalOcean Backups at a Glance

  • Price: Enabling backups for a Droplet adds 20% to the cost of the Droplet.
  • Retention: Backups are taken once per week, and each backup is retained for four weeks.
  • Availability: Backups are available for all Droplets across all regions.

Enabling Backups on a New Droplet

You can enable backups during Droplet creation.

To create a new Droplet with backups enabled, log in to your DigitalOcean account, open the Create menu, and select Droplets. Choose the distribution and Droplet size that fits your needs. Under the Select additional options header, click the Backups checkbox:

Enable Backups During Droplet Creation

Once you have selected any other options, choose a hostname for the Droplet and click Create.

Note: Enabling backups for a Droplet adds 20% to the monthly Droplet cost.

If you're using the API to create a Droplet, you can enable backups by adding "backups": true to the request body.

Enabling Backups on an Existing Droplet

You can enable backups for any existing Droplet through the DigitalOcean Control Panel.

If you didn't enable backups during Droplet creation, you can still enable them at any time through the DigitalOcean Control Panel.

To enable backups on an existing Droplet, navigate to the list of Droplets for your account, click the Droplet name for which you'd like to enable backups, and then click the Backups menu item. This will display the cost of backups for the given Droplet. Click the Enable Backups button to enable backups.

Enable Backups for an Existing Droplet

Backup Schedule

Once you've enabled backups, they will be scheduled to occur weekly during a specific time window which is automatically assigned by DigitalOcean. To view the time window when your backups will start, navigate to your Droplet in the DigitalOcean Control Panel, and click the Backups link.

In the Backups block, there will be a line like this:

Backups are currently enabled. They are scheduled to start weekly Sunday 3 PM to Monday 2 PM.

Backups for your Droplet will start sometime during the specified time window, but depending on when the backup is started and how large of a disk is being backed up, it may not complete by the end of the window listed.

Interacting With Backups

Once you have enabled backups for a Droplet, there are a few ways to interact with them. First, navigate to the Droplet in the DigitalOcean Control Panel, and then click the Backups link. If at least one backup has been taken for your Droplet, it will be listed in the Droplet backups section with a drop-down menu offering the following options:

  1. Convert to Snapshot
  2. Create Droplet
  3. Restore Droplet

Convert to Snapshot

Choosing this option will convert the selected backup to a DigitalOcean Snapshot. Unlike backups, which are only retained for four weeks, a Snapshot is retained indefinitely. When you choose to convert a backup to a Snapshot, it will be removed from the list of available backups and added to the list of snapshots.

Note: Once a backup is converted to a Snapshot, snapshot pricing of $0.05/GB per month applies.

Converting a backup to a Snapshot can be useful if there is a backup that you would like to retain for an extended period of time. It's also useful if you would like to copy a snapshot to different regions, which is possible with a snapshot, but not with a backup.

Create Droplet

Choosing Create Droplet from a backup allows you to create a new Droplet with the disk contents that were saved in the selected backup. This is useful for creating new Droplets with the same data and configuration as the Droplet being backed up. Alternatively, this can be used if you need to view or restore a small number of files to the original Droplet.

Once the new Droplet is created from the backup, you will be able to copy files to the original Droplet using SCP or rsync. See How To Copy Files With Rsync Over SSH for more information on copying files between servers with rsync.

Restore Droplet

Selecting Restore Droplet from a backup will replace the current Droplet with the backup image. Clicking this option will bring up a window to confirm the action.

Restore Droplet Confirmation

Restoring from a backup will take your Droplet offline during the restoration process and bring it back online matching the point in time that the backup was taken. This is useful if you want to completely revert a Droplet to an older point in time, but you will lose any changes on the Droplet that happened after the backup was taken.

Disabling Backups

Backups can be disabled at any time under the Backups section of the Droplet Control Panel. Disabling backups will delete any existing backup images for the Droplet, so make sure to convert any backup images you want to save to Snapshots first.

What's Next?

In this article, we covered the basics of using Droplet backups for new and existing Droplets. Droplet backups are an effective, easy-to-configure backup solution for many Droplet use cases. However, they don't fit every use case.

To make sure Droplet backups fit your use case:

2 Comments

Creative Commons License