n8n

How to Automate DigitalOcean Snapshot Management?

Keep your servers safe without babysitting backups. On a set schedule, the system trims old DigitalOcean snapshots and saves a fresh one, so you have recent restore points and controlled storage use. Ideal for small teams and agencies that manage a few droplets and want simple snapshot rules.

Every 48 hours a schedule starts the run. The flow calls the DigitalOcean API to list droplets, then gets snapshots for the target droplet. A filter checks if the snapshot count is four or more. When it hits the limit, one older snapshot is removed, and a new snapshot is created with a droplet action. All calls use header auth with your DigitalOcean API token. The result is steady snapshot rotation without logging in.

You only need a DigitalOcean account and an API token with write access. In n8n set header auth on the HTTP Request nodes, adjust the snapshot limit in the filter, and pick the schedule that fits your backup plan. By default the flow points at the first droplet in the list, so confirm the expressions target the droplet you want. Expect to cut weekly backup chores and keep storage tidy for client sites, staging servers, and single app droplets.

What are the key features?

  • Scheduled run every 48 hours with easy timing changes
  • Calls the DigitalOcean API using HTTP Request nodes
  • Lists droplets and retrieves snapshots for the selected droplet
  • Filter checks if the snapshot count meets your set limit
  • Removes an older snapshot when the limit is reached
  • Creates a new snapshot using the droplet action endpoint
  • Header authentication with a DigitalOcean API token
  • Clear canvas notes describe each step for quick setup

What are the benefits?

  • Reduce manual backup checks from 60 minutes to 5 minutes per week
  • Automate 100 percent of snapshot rotation on a fixed schedule
  • Control storage by keeping at most 4 snapshots per droplet
  • Lower restore risk by always creating a fresh snapshot after cleanup
  • Use one API token and no extra tools for simple maintenance

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with DigitalOcean. See the Tools Required section above for links to create accounts with these services.
  3. In your DigitalOcean dashboard, create a Personal Access Token with read and write permissions for droplets and snapshots. Copy the token to a safe place.
  4. In the n8n credentials manager, create a new HTTP Header Auth credential. Add a header named Authorization with the value Bearer YOUR_DIGITALOCEAN_TOKEN and save it.
  5. Open the List All Droplets node and select your DigitalOcean header credential in the Credential to connect with field.
  6. Open the List Snapshots for a Droplet node and select the same credential. Confirm the URL uses the droplet id expression. If you want a specific droplet, replace the expression with that droplet id.
  7. Open the Filter node and set the limit value to your retention rule. It is set to 4 by default.
  8. Open the Delete a Snapshot node, choose the same credential, and confirm the method is DELETE. Run a test on a non critical droplet.
  9. Open the Droplet Actions snapshot node, select the same credential, and confirm the body type is snapshot so a new backup is created.
  10. Open the Runs every 48hrs node and change the schedule if you want daily, weekly, or another interval.
  11. Run the workflow once with a test droplet. Check DigitalOcean to see if a new snapshot appears and an older one is removed only when the limit is met.
  12. If you see 401 errors, verify the token and header name. If you see 404 errors, confirm the droplet id is correct. If nothing changes, check that the snapshot count meets the filter rule.
  13. When the test looks good, activate the workflow in n8n so it runs on the schedule.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

DigitalOcean

Sign up

Basic Droplet: $4 / mo (512 MiB RAM, 1 vCPU). API access included; Droplet snapshots: $0.06/GB-month

Credits:
Built for the Let's Automate It Community by Optimus Agency.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.