I've been self-hosting this blog on my Cloudron instance for a couple weeks now and have been getting nervous about data loss. Cloudron backs up to the local filesystem by default, but that doesn't help in the event of a catastrophe.

you've been warned

Remote backups are indeed a must, and this post covers what I did to set them up. It was quick, easy and cheap.

Read the docs

Start with Cloudron's backup docs. They're brief but comprehensive.

Choose a storage provider

Cloudron integrates with a number of storage services like AWS S3, Backblaze B2 and Google Cloud Storage. Alternatively, you can use NFS and similar protocols to transfer files to one of your other machines.

I chose Backblaze B2 as a provider for the following reasons:

  • I'd used their personal backup solution and had been happy with it
  • It's cheaper than the competition and the first 10GB of storage are free
  • Backblaze is independent and has been around for many years
  • Their business model is user-focused and privacy-friendly
  • I didn't have another machine available to do backups to over NFS, etc.

Using the B2 storage calculator, I estimate I'll spend around $10/year for my Cloudron backups, so costs are negligible.

Configure remote backups

I won't repeat the instructions from Cloudron's B2 backup docs (they're simple), but here are a couple notes on the options you'll encounter.

Choose a storage format

I chose rsync over the default tgz storage format because rsync should require less storage and bandwidth, and thus a lower B2 bill. The tradeoff is that rsync may take longer than simple tgz uploads because many more requests can be involved. I'll have to see it goes in the long run, but so far I'm happy with it.

Encrypt files locally

Backblaze's personal backup solution integrates end-to-end encryption, but its B2 service does not. To avoid storing your backups in cleartext, you must encrypt them locally prior to upload. Fortunately, Cloudron provides integrated support for doing so and encrypts both file names and contents. Just set a passphrase and you're good to go.

Test everything

Merely enabling remote backups without testing them risks giving a false sense of security. For example, are you certain you wrote down your encryption passphrase correctly? Here's how to do a complete app recovery to make sure it works as expected.

Run a manual app backup

  1. Create a backup of one of your apps
  2. Verify that the upload shows up as expected in your storage provider's web interface (optional)

Recover the app from scratch

Cloudron supports cloning a new app from a backup and restoring an existing app to one of its prior backups, but the best way to simulate a real disaster scenario is to recover a backup "from scratch", i.e. into a newly installed app. Assuming the app you've just backed up is named blog, take the following steps:

  1. Install a fresh instance of the app with a different name e.g. blog2
  2. Import your backup into it
  3. Verify recovery worked , i.e. all your data shows up
  4. Uninstall (delete) the blog2 app

Doing it this way mimics restoring from backup into a brand new Cloudron instance or migrating an app from one Cloudron instance to another. In the process, you'll be forced to manually enter your storage provider secret key as well as your encryption passphrase, so you'll know for sure that both are written down correctly.

Rest easy

This process helped me appreciate just how smooth Cloudron makes working with backup and recovery. It took me under an hour and my concerns about data loss are gone.