LanternlyDocs

Keep it safe

Backups

Backups go to any S3-compatible bucket you own, encrypted with a key only you hold before they leave the console. Each service has its own schedule, and backups are also taken before upgrades, restores and removals.

How it works

  • The console collects each part of a backup from the server over its SSH connection, encrypts it with the backup key and uploads it. Your servers never see the bucket keys and never talk to the bucket.
  • Files are stored once per content, so frequent backups mostly cost the size of the database dump.
  • Optionally, the image each backup needs is saved once in the bucket too, so a restore still works if the image is deleted from its registry.
  • Until a bucket is set up, each server keeps a nightly database copy on its own disk (14 days).

Set up the bucket (once)

  1. Create a private bucket in any S3-style store: AWS S3, Lightsail object storage, Backblaze B2, Cloudflare R2, Wasabi or MinIO. Pick a region near your servers.
  2. Create an access key that can read and write that bucket.
  3. On Backups → Set up the bucket, fill in the bucket name, region and both key parts. For anything other than AWS, open Advanced → Storage address and enter the store's S3 endpoint (for example https://<account>.r2.cloudflarestorage.com).
  4. Choose the schedule new services get and press Save, then Test the bucket: it writes a test file, reads it back and deletes it.
  5. A Save the backup key now box appears. Put the key in your password manager, tick I have saved the backup key somewhere safe and press Done.
Losing the backup key means losing the backups

Everything in the bucket is encrypted with it. If the deployer VM is lost, the key is the only way to read them. To see it again later, press Show backup key and enter a two-step code.

Keep the bucket somewhere else

A bucket in the same cloud account as your servers doesn't protect you from losing that account. A bucket with another provider does.

Schedules

Each service has its own schedule, under Backups on its page (Change the schedule):

  • Daily at the hour you pick, in the default time zone. New services get daily at 2am, kept 30 days, unless you change the default.
  • Frequent: every hour or every 6 hours, with its own keep period. A frequent backup is skipped when the daily one has just run.
  • Always: before every database upgrade, before every restore and before a service is removed. Back up now takes one by hand.

Changing a keep period applies to existing backups too. The newest good backup of a running service is never deleted, whatever its age. Failed backups are cleaned up after two days. A removed service's backups are kept for the period set on the Backups page (30 days by default).

Watching backups

The Backups page lists every service's last good backup, how many it has, the space they use and a flag when one failed or is overdue, plus the bucket's total use. When a scheduled backup fails, or none has worked for twice the usual gap, an email goes to the alert addresses, and another when backups work again.

Restore

On the service's page, under Backups, open Restore for the backup you want. Only owners can restore, with the service's name and a fresh two-step code.

  • Put this service back: a safety backup is taken first, then the data is replaced. If the service doesn't start afterwards, it's put back as it was. Its addresses and settings stay as they are now.
  • Make a copy at a new address: creates a separate service from the backup, so you can look at old data without touching the live one. Remove it when you're done. For a database, the copy is a new database in the same project.

Restores are listed in the service's History like every other change.

Read backups without the console

If the deployer VM is lost, scripts/backup-tool.mjs in the repo reads the bucket directly with the backup key and the bucket keys, checking every checksum:

export BACKUP_KEY=…  BUCKET=my-backups  REGION=eu-central-1
export AWS_ACCESS_KEY_ID=…  AWS_SECRET_ACCESS_KEY=…
node scripts/backup-tool.mjs list
node scripts/backup-tool.mjs fetch <service folder> <backup> ./out

A database backup comes out as database.dump, which you load with pg_restore --no-owner.

Moving to a new provider

Because backups live in your bucket, moving is: set up a services VM at the new provider, add it under Servers, then restore each service as a copy on the new server and move your domains. The old server can then be emptied and removed.

Edit this page on GitHub