storage
Longhorn S3 Backup Config Generator
Generate Longhorn S3 backup configuration: credentials Secret, BackupTarget settings, StorageClass, and RecurringJob YAML. Works with Hetzner Object Storage, AWS S3, and any S3-compatible endpoint.
Longhorn S3 Backup Architecture
Longhorn provides two levels of data protection: local snapshots (on-disk) and remote backups (S3). For true disaster recovery — surviving a full cluster loss — you need remote S3 backups.
Backup vs Snapshot
| Snapshot | Backup | |
|---|---|---|
| Storage location | Same disk as volume | S3 (remote) |
| Survives node failure | Partially (with replicas) | Yes |
| Survives cluster loss | No | Yes |
| Speed | Fast | Slower (upload) |
| Use case | Quick recovery, dev | Disaster recovery |
Backup Process
- 1.Longhorn takes a volume snapshot
- 2.Computes incremental diff since last backup
- 3.Compresses and uploads delta blocks to S3
- 4.Updates backup metadata
The incremental nature means backups after the first are small — only changed blocks are uploaded.
Hetzner Object Storage Setup
- 1.Create bucket: Hetzner Console → Object Storage → Create Bucket
- 2.Generate credentials: Object Storage → Access Keys → Add Key
- 3.Use endpoint:
https://s3.eu-central-1.amazonaws.com - 4.Region:
eu-central-1
Hetzner S3 costs €0.0119/GB/month — a 100 GB backup costs ~€1.19/month.
RecurringJob Groups
Longhorn uses RecurringJob groups to apply backup schedules to volumes. When you create a StorageClass with recurringJobSelector: '[{"name":"backup","isGroup":true}]', all volumes created from that StorageClass automatically inherit the backup schedule.
Key Terms
Full glossary →Longhorn
A cloud-native distributed block storage system for Kubernetes. Longhorn creates replicated volumes across nodes and supports incremental backups to S3-compatible storage.
CSI (Container Storage Interface)
A standard interface for exposing storage systems to Kubernetes. CSI drivers allow storage vendors (Longhorn, Ceph, etc.) to provide persistent volumes to pods.
PVC (PersistentVolumeClaim)
A request by a pod for storage. A PVC binds to a PersistentVolume provisioned by a storage class (e.g. Longhorn). The PVC lifecycle is independent of the pod lifecycle.
Frequently Asked Questions
Does Longhorn support Hetzner Object Storage as a backup target?
Yes. Hetzner Object Storage is S3-compatible. Use the endpoint https://s3.eu-central-1.amazonaws.com with region eu-central-1. Create the bucket in the Hetzner Console and generate an access key under Object Storage → Access Keys.
What is a RecurringJob in Longhorn?
A RecurringJob is a Longhorn CRD that defines scheduled snapshot or backup operations. The 'backup' task takes a snapshot and uploads it to the configured S3 target. The 'snapshot' task only takes a local snapshot without uploading. For disaster recovery, always use 'backup' to push to S3.
How do I restore a Longhorn volume from S3 backup?
In Longhorn UI: Backup → select your backup → Restore. You can restore to a new PVC or directly replace an existing volume. For full cluster disaster recovery, restore etcd first (the cluster state), then restore Longhorn volumes.
Is the access key stored securely in the generated YAML?
The generated YAML uses placeholder values (YOUR_ACCESS_KEY_ID). Replace these before applying. In production, use an external secrets manager (Vault, Sealed Secrets) to inject the secret, rather than storing credentials in plain YAML files or Git.
Related Calculators
Related Generators
Related Comparisons
Related Guides
storage
Kubernetes Storage in 2026: When to Use Longhorn, Rook-Ceph, or OpenEBS
A deep dive into the three most popular self-hosted Kubernetes storage solutions — what each does well, how to install and configure Longhorn, and how to choose between them.
storage
Longhorn vs Rook/Ceph for Kubernetes Storage: Which Should You Use?
A practical comparison of Longhorn and Rook/Ceph for self-hosted Kubernetes storage — setup complexity, resource usage, performance, and when each is the right choice.