Upgrades, Backups & Recovery
This guide covers backups, disaster recovery, and safe upgrades for both FynnCloud AIO (automated) and Docker Compose / Kubernetes (manual).
FynnCloud AIO: Consistent Encrypted Backups
Section titled “FynnCloud AIO: Consistent Encrypted Backups”AIO integrates restic directly into the supervisor so backups are encrypted client-side with AES-256, deduplicated, and crash-consistent across PostgreSQL and file blobs.
Supported Backup Targets
Section titled “Supported Backup Targets”Configure backups in Administration → System → Backups (requires Step-Up verification for action backups:config):
local— Local path or mounted external/NFS drive inside the AIO hosts3— Any S3-compatible bucket (AWS S3, Cloudflare R2, Backblaze B2, Hetzner Object Storage, MinIO, Wasabi)sftp— Remote SFTP backup server (such as Hetzner Storage Box)
How Crash-Consistent Snapshots Work (backup.lock)
Section titled “How Crash-Consistent Snapshots Work (backup.lock)”- Write-Freeze Window: Before taking a snapshot, AIO creates
/run/fynncloud-aio/backup.lock.fynncloud-server’sBackupFreezeMiddlewaredetects this lock immediately and rejects mutating file/database requests with503 Service UnavailableandRetry-After: 5, while read requests continue serving normally. The nightlyTrashCleanupJobalso skips execution if a backup is in progress. - Consistent Export: AIO streams a consistent PostgreSQL dump + roles (
pg_dump+pg_dumpall --roles-only) alongside the current/data/stack.yamlinto staging, then takes a single atomicrestic backupcovering:- PostgreSQL database dump + roles
/data/stack.yamldesired state- Live
fynncloud_server_storageuser blobs & file versions - Installed app persistent data volumes (
fynncloud_app_data_*)
- Lock Release & Retention Pruning: Once the snapshot finishes,
backup.lockis removed immediately andrestic forget --pruneenforces yourkeep_daily(default7),keep_weekly(default4), andkeep_monthly(default6) policy. - Automated Weekly 5% Restore Drill: AIO periodically runs
restic check --read-data-subset=5%(also triggerable on demand via Verify Backup Drill /POST /api/admin/system/backups/verify) to detect silent bit-rot or corrupted remote chunks before you ever need a restore.
The Recovery Kit (Save This Off-Server!)
Section titled “The Recovery Kit (Save This Off-Server!)”Every AIO instance has a 6-field Recovery Kit JSON containing the cryptographic keys required to decrypt backups and restore your instance onto a brand-new server if the original host is destroyed:
- Export it from Administration → System → Export Recovery Kit (protected by Step-Up action
recovery-kit), or - Print it from the host CLI (required if
AIO_ALLOW_SOCKET_RECOVERY_KIT=false):
docker exec fynncloud-aio fynncloud-aio recovery-kit > fynncloud-recovery-kit.jsonchmod 600 fynncloud-recovery-kit.jsonDisaster Recovery on a Fresh Server
Section titled “Disaster Recovery on a Fresh Server”- Install Docker on the new server and run
fynncloud-aio setup --domain cloud.example.comas usual. - Open the printed Setup URL (while 0 users exist in the fresh database).
- Instead of creating a new admin account, select Restore from Backup (
POST /api/setup/restore), provide your backup repository credentials and Recovery Kit keys, choose the snapshot, and confirm. - AIO restores PostgreSQL, user storage, app volumes, and
stack.yaml, then reconciles and brings the full stack back online with every user, file, share link, 2FA secret, and installed app intact.
You can also restore an existing running instance to an earlier snapshot from Administration → System → Backups → Restore (protected by Step-Up action restore).
FynnCloud AIO: Signed Atomic Updates & Rollback
Section titled “FynnCloud AIO: Signed Atomic Updates & Rollback”Signed Release Envelopes (ECDSA P-256)
Section titled “Signed Release Envelopes (ECDSA P-256)”AIO polls AIO_RELEASE_FEED_URL (https://releases.fynncloud.ch/aio/v1, channel stable or beta) for JSON release envelopes signed with an ECDSA P-256 key pinned inside the supervisor binary. Every image reference in a release is pinned by immutable @sha256: digest (not mutable tags).
- Air-gapped / private mirrors: Override
AIO_RELEASE_FEED_URL, supply your own signing key viaAIO_RELEASE_PUBLIC_KEY_PEM, and setAIO_ALLOW_CUSTOM_RELEASE_REPOS=trueif serving from a private registry. - Downgrade protection: Applying an older version than currently installed is blocked unless
AIO_ALLOW_DOWNGRADE=true.
Atomic Apply & Automatic Rollback
Section titled “Atomic Apply & Automatic Rollback”When you trigger Apply Update in Administration → System (Step-Up action updates:apply):
- AIO verifies the ECDSA P-256 signature and pre-pulls every digest-pinned container image.
- AIO snapshots the pre-update
stack.yamland pinned digests, then recreates containers in dependency order and waits for healthchecks. - If
fynncloud-server,fynncloud-web, orfynncloud-proxyfails its healthcheck window, AIO automatically rolls back to the previous digest-pinned images and restores service.
Supervisor Self-Swap (fynncloud-aio-upgrader)
Section titled “Supervisor Self-Swap (fynncloud-aio-upgrader)”When a newer version of fynncloud-aio itself is available (triggered via Update Supervisor with Step-Up action updates:apply, or CLI fynncloud-aio upgrade), the running supervisor spawns a short-lived helper container (fynncloud-aio-upgrader) that pulls the verified new AIO image, stops and replaces fynncloud-aio preserving all /data and socket mounts, verifies the new supervisor starts cleanly, and removes itself.
Manual Upgrades & Backups (Docker Compose)
Section titled “Manual Upgrades & Backups (Docker Compose)”Backing Up Docker Compose
Section titled “Backing Up Docker Compose”# 1. Dump PostgreSQL databasedocker exec fynncloud-db pg_dump -U fynncloud -Fc fynncloud > fynncloud_$(date +%F).dump
# 2. Archive .env (contains SECURITY_ENCRYPTION_KEY & AUTH_JWT_SECRET!)cp .env fynncloud_env_$(date +%F).bak
# 3. Back up server_storage volume (if using local storage instead of S3)docker run --rm \ -v fynncloud_server_storage:/source:ro \ -v "$(pwd)":/backup \ alpine tar czf /backup/storage_$(date +%F).tar.gz -C /source .Upgrading Docker Compose
Section titled “Upgrading Docker Compose”- Take a fresh database backup first.
- Update
SERVER_IMAGEandWEB_IMAGEtags in.env(or pull latest tags). - Pull and recreate containers:
docker compose pulldocker compose up -dDatabase migrations run automatically on startup when DATABASE_AUTO_MIGRATE=true (the Compose default). If DATABASE_AUTO_MIGRATE=false, run docker compose run --rm server ./FynnCloudServer migrate -y before starting the new server container.
Rotating SECURITY_ENCRYPTION_KEY Without Downtime
Section titled “Rotating SECURITY_ENCRYPTION_KEY Without Downtime”To rotate SECURITY_ENCRYPTION_KEY without invalidating user 2FA TOTP secrets or encrypted .secret settings:
- Move your current
SECURITY_ENCRYPTION_KEYvalue intoENCRYPTION_PREVIOUS_KEYS(comma-separated if rotating multiple generations). - Generate a new 32+ byte key (
openssl rand -base64 32) and set it asSECURITY_ENCRYPTION_KEY. - Restart
fynncloud-server.SecretBoxdecrypts existing records usingENCRYPTION_PREVIOUS_KEYSand encrypts all newly saved secrets with the new primary key.