Langfuse backup and restore starts with knowing which stores hold your data
To recover traces, prompts and evaluations after a failure, you need a backup for each data store in your self-hosted Langfuse deployment, tested by restoring it. Start by listing every store, what it holds and who owns its backup. Langfuse keeps its data across several components, and a backup of one store does not restore the others. Treat the backup plan as a per-store plan, with a named owner and a restore test for each one.
A self-hosted deployment runs two application containers, Langfuse Web (the UI and APIs) and Langfuse Worker (asynchronous event processing). The data sits in PostgreSQL, ClickHouse, Redis or Valkey, and S3-compatible blob storage. The work differs for each. PostgreSQL holds the relational records such as projects, users and prompt configuration, and is usually backed by a managed service or a dump. ClickHouse holds the high-volume trace, observation and score tables, which need their own snapshot or BACKUP approach. Blob storage holds media and other objects referenced from the database, so its backup must stay in step with the references stored elsewhere.
Redis or Valkey acts as a cache and queue layer for event processing rather than a system of record. Before you decide to back it up, confirm with the vendor docs whether your Langfuse version needs it preserved for recovery, or whether it can be rebuilt on restart. Write that decision down with the rest of your store inventory, including the recovery owner for each store and the backup schedule you intend to test. Use the Langfuse backup strategies guide as the starting point for each store's procedure.
Which data store needs which backup
A self-hosted Langfuse keeps its data in several stores, and each one fails differently and is backed up differently. Treat the set as one restore unit: a ClickHouse backup without the matching PostgreSQL state can leave projects, keys and prompts pointing at data that no longer exists. Confirm each store's backup method and restore order in your own environment before go-live.
ClickHouse analytical data
ClickHouse holds the observations, scores and other analytical data that make up most of your trace history, so it is usually the largest store to protect. The Langfuse backup guide documents volume snapshots for self-hosted ClickHouse on Kubernetes, including the ZooKeeper volumes, and ClickHouse BACKUP and RESTORE to S3 as an alternative. Check that your snapshots cover every replica and coordination volume, and rehearse a restore into a separate environment. Do not restore from blob storage exports, which are meant for analytics.
Backup strategiesPostgreSQL configuration state
PostgreSQL stores users, organizations, projects, prompts and configuration, so losing it breaks access and prompt history even if trace data survives. Langfuse recommends a managed database service where possible. For self-hosted instances, the guide shows pg_dump CronJobs or volume snapshots. Choose one, schedule it, store dumps outside the cluster, and test that a dump restores with the same schema version as the running Langfuse release.
Blob storage media and exports
Blob storage holds uploaded media attachments and scheduled exports. Its backup only matters when you run SeaweedFS or MinIO yourself, because the guide limits that need to deployments not using cloud object storage such as Amazon S3, Azure Blob Storage or Google Cloud Storage. If your bucket is a managed cloud service, confirm its versioning and replication settings with the provider instead. Confirm which buckets hold media that ClickHouse references, since losing them leaves broken links in traces.
Redis or Valkey cache and queue
Redis or Valkey handles cache and queue work for ingestion. It holds transient data rather than the system of record, so the usual approach is to rebuild it rather than restore it. Confirm with Langfuse or your deployment documentation which queued events could be lost during a failure, and how the worker recovers. Record that answer in your runbook, because it decides whether you need any persistence or backup for this store.
ClickHouse, PostgreSQL and blob storage backup methods
ClickHouse holds the observations, traces and scores that make up most of a self-hosted Langfuse dataset, so it is usually the store that needs the most planning. Langfuse's backup guide describes three routes: volume snapshots for a self-hosted ClickHouse on Kubernetes, Velero cluster backups, and ClickHouse BACKUP and RESTORE commands writing to S3. Snapshots are the most direct when your storage layer supports them, but they must cover the ZooKeeper volumes as well as the data volumes, or the restored cluster may not start cleanly.
- Volume snapshots: Snapshot every ClickHouse data volume and the ZooKeeper volumes at the same point in time, and test that a restored cluster starts.
- Velero cluster backups: Velero can back up Kubernetes resources and persistent volumes together, which helps when you need to rebuild the whole namespace.
- Native BACKUP to S3: ClickHouse can write its own backups to an S3 bucket with
BACKUPand restore them withRESTORE, which works without storage-level snapshot support. - Retention and location: Keep backups in a separate account or region from the live cluster, and set retention so older copies expire on a defined schedule.
- Restore rehearsal: Restore into a separate environment on a regular schedule and confirm that Langfuse reads the restored data.
Confirm with your ClickHouse operator or vendor which snapshot and BACKUP options your version and storage class support, and whether ZooKeeper state needs special handling in your topology.
PostgreSQL stores the Langfuse configuration data, including organizations, projects, users, prompts and API keys, so losing it is a different problem from losing trace history. Langfuse's backup guide recommends a managed database service where one is available, because the provider handles backups and point-in-time recovery. For a self-hosted PostgreSQL, the guide shows two patterns: pg_dump run on a schedule from a Kubernetes CronJob, or volume snapshots of the database storage.
- Managed service first: Where your cloud provider offers managed PostgreSQL, use its automated backups and confirm the retention window and restore procedure.
- pg_dump CronJobs: A scheduled
pg_dumpproduces logical copies that are easy to inspect and move, but restores take longer on large databases. - Volume snapshots: Snapshots of the database volume are faster to take and restore, but they must be consistent with the database state at the snapshot point.
- Offsite copies: Write dumps or snapshot copies to storage outside the cluster, with access limited to the backup role.
- Restore test: Restore the latest backup into a scratch database and confirm that Langfuse starts against it.
Confirm with your database team the backup schedule, the recovery point you need, and the restore time your organization accepts before choosing between dumps and snapshots.
Blob storage holds the files Langfuse stores outside the databases, such as uploaded media and exports. Langfuse's backup guide says SeaweedFS or MinIO backups matter only for deployments that do not use cloud object storage such as Amazon S3, Azure Blob Storage or Google Cloud Storage. If your Langfuse writes to a managed cloud bucket, the provider's durability and versioning features replace the need for a separate MinIO or SeaweedFS backup job, although you should still confirm how versioning and replication are configured.
- Cloud object storage: Confirm that bucket versioning, replication or provider backup features are enabled, and that deletion protection is in place.
- Self-hosted SeaweedFS or MinIO: Back up the object store itself with a method suited to its deployment, such as replication to a second cluster or scheduled copies to another bucket.
- Consistency with databases: Blob copies and database backups should be taken close together, so references in PostgreSQL and ClickHouse point to objects that still exist.
- Access control: Restrict credentials for backup jobs to the buckets they need, and rotate them on your standard schedule.
- Restore test: Restore a sample of objects and confirm that Langfuse can read them.
Confirm with your storage team whether your deployment uses cloud object storage or a self-hosted S3-compatible store, since that decides whether this tab's work applies to you.
The backup method for each store has to match how Langfuse is deployed. A Docker Compose installation on a single VM uses different tools from a Kubernetes deployment with Helm, and bundled data stores behave differently from managed services. Langfuse documents Docker Compose on a single VM for testing, without high availability, and Kubernetes with Helm or Terraform for production, so the options above apply most directly to Kubernetes-based setups. On a VM, you will typically rely on host-level snapshots or scheduled dump jobs instead of CronJobs and Velero.
- Kubernetes with bundled stores: Snapshots, Velero and in-cluster CronJobs are the common options, and they must cover every stateful component.
- Kubernetes with managed services: Use the provider's backup features for PostgreSQL and object storage, and back up ClickHouse separately.
- Single VM: Schedule host-level or dump-based backups and store copies off the host.
- Consistency across stores: Align snapshot times or dump schedules so the stores restore to a compatible state.
- Documented procedure: Write the restore order and the commands each team runs, and keep them with the runbook.
Confirm the exact backup configuration with Langfuse and with your ClickHouse, PostgreSQL and storage vendors for your version, since procedures change between releases.
Backup options per store and when each fits
This table compares the backup methods Langfuse documents for each self-hosted data store, with the conditions under which each one fits. Read each row against your platform (Kubernetes, VM or managed cloud services), then use the confirm column to settle consistency, restore testing and who holds the credentials before you commit to a method.
| Store | Method | When it fits | What to confirm |
|---|---|---|---|
| ClickHouse | Volume snapshots | Self-hosted ClickHouse on Kubernetes, where the storage class supports snapshots and the ZooKeeper volumes can be captured alongside the data volumes | Whether the snapshot is consistent across all ClickHouse volumes, who can read and restore snapshots, and that a restore has been rehearsed in a separate cluster |
| ClickHouse | BACKUP and RESTORE to S3 | Self-hosted ClickHouse where you want backups written to object storage that you control, independent of the cluster's volumes | The S3 bucket's location and retention, the IAM role or key used by ClickHouse, and that the RESTORE target ClickHouse version is compatible with the backup |
| Cluster resources | Velero | Kubernetes clusters where you want cluster objects and volumes backed up together through one tool | Which namespaces and volumes are included, whether snapshot hooks quiesce ClickHouse, and who owns the Velero backup storage location credentials |
| PostgreSQL | Managed database service backups | Production deployments on a managed PostgreSQL service, which the Langfuse backup guide recommends | The point-in-time recovery window, backup retention, cross-region copies, and whether you can restore to a new instance without vendor support |
| PostgreSQL | pg_dump CronJob | Self-hosted PostgreSQL where you want logical dumps stored in a location you control | Dump schedule against your recovery point objective, dump completeness for the Langfuse database, storage encryption, and a test restore into an empty instance |
| PostgreSQL | Volume snapshot | Self-hosted PostgreSQL on Kubernetes or a VM platform with snapshot support | Whether the snapshot is taken from a consistent state (for example, after a checkpoint or with the database paused), and how long restores take in your environment |
| SeaweedFS or MinIO blob storage | Bucket or volume backup to a separate target | Only deployments that store media and exports on SeaweedFS or MinIO rather than cloud object storage such as Amazon S3, Azure Blob Storage or Google Cloud Storage | Whether the backup target is in a separate failure domain, the consistency between the blob store and the database references to it, and the restore procedure |
Why blob storage exports cannot restore a ClickHouse database
Langfuse warns that blob storage exports are for analytics and should not be used as the restore path for a ClickHouse database. Treat the scheduled export as a second copy of your data in a different shape, not as a backup you can load back into a running Langfuse. The Langfuse backup guide covers the supported restore paths, and the export is not one of them.
An export carries the rows you chose to write out, in the format and columns the export job produces. It does not carry the full ClickHouse state needed to rebuild the database: table definitions, engine and partition layout, materialized views, the ZooKeeper coordination data used with replicated tables, and the metadata that tells ClickHouse which parts belong to which table. A restore from files in object storage would have to rebuild all of that by hand, and a missed table or column would surface only after users start querying. Ask your Langfuse and ClickHouse operators to list every object that a complete restore needs, then confirm each one is covered by a backup you have tested.
A restore therefore needs a ClickHouse-native backup, either volume snapshots that include the ZooKeeper volumes or ClickHouse BACKUP and RESTORE to S3, as described in the backup guide. This is the path your restore runbook and recovery time estimate should be built around. Scheduled exports remain useful for analytics, long-term archiving and moving data to other tools, and the separate page on scheduled export to blob storage covers their format and credential choices. Keep the two jobs separate in your design so that a team never restores from the archive by mistake.
How to set up and test Langfuse backups
This sequence takes a self-hosted Langfuse deployment from an unknown backup state to a backup set that has been restored into a non-production environment and checked against live Langfuse behavior. Each step ends with a check you can record as evidence.
Inventory every data store in the deployment
List each stateful component in your Langfuse deployment: PostgreSQL, ClickHouse (including ZooKeeper volumes where your deployment uses them), Redis or Valkey, and S3-compatible blob storage. Record where each one runs, whether it is a managed cloud service or self-hosted, and who owns it. Redis or Valkey is typically treated as a cache for this purpose, so confirm with your own design whether it holds data you need to recover. The step is done when every store has an owner and a location in a written inventory that the platform team signs off on.
Choose a backup method for each store
For each store, pick the method that fits where it runs. The Langfuse backup guide recommends managed database services for PostgreSQL and shows pg_dump CronJobs or volume snapshots for self-hosted instances. For ClickHouse on Kubernetes, the guide recommends volume snapshots, including ZooKeeper volumes, and also documents ClickHouse BACKUP and RESTORE to S3 and Velero cluster backups. Mark SeaweedFS or MinIO as needing its own backup only if you do not use cloud object storage such as Amazon S3, Azure Blob Storage or Google Cloud Storage. Do not choose a blob storage export as the ClickHouse restore path, because Langfuse warns that exports are for analytics. The step is done when the inventory lists one method per store and a reason for each.
Configure backup schedules and S3 credentials
Create the scheduled jobs or snapshot policies for each store, and create the S3 bucket and a dedicated credential that only the backup jobs can use. Grant the write permissions the chosen method needs and avoid reusing the credentials Langfuse uses for its own blob storage. Set retention on the backup bucket according to your policy. Confirm the exact ClickHouse BACKUP syntax and the required IAM actions against the current ClickHouse and cloud provider documentation for your versions. The step is done when a manual run of each job completes without error and produces an object or snapshot you can list.
Store backups in a separate account or location
Copy backup output to a location that the production account cannot modify or delete with routine credentials. This can be a separate cloud account, a different region, or a bucket with object lock or versioning enabled, depending on what your provider and policy support. Confirm which of these controls your provider offers and how they interact with your retention rules. Restrict who can read backups, since they contain the same personal data as production traces. The step is done when a test credential from the production account cannot delete a backup object, and the access review lists who can read the backup location.
Run a full restore into a non-production environment
Build a separate Langfuse environment with the same major version and the same data store versions as production. Restore PostgreSQL, then ClickHouse, then blob storage from the backups created in the previous steps, following the restore procedure for each method. Restore to a target that is isolated from production, with its own secrets and endpoints, so that no restored component can write to live systems. Record the time and the exact backup identifiers used. The step is done when all data stores are restored and reachable from the non-production Langfuse Web and Worker containers.
Verify that Langfuse starts and shows expected data
Start Langfuse Web and Worker against the restored stores and check the health endpoints and logs for connection or migration errors. Sign in, then confirm that a known set of traces, observations, scores and prompts from a chosen date range appears in the UI and through the API. Compare counts or spot-check specific trace IDs against the production record at the backup time. Confirm that prompt versions and labels match. The step is done when the checklist of known items passes and the result is recorded with the backup identifiers used.
Document the runbook and repeat the test on a schedule
Write down the exact restore order, commands, credentials locations, owners and the verification checklist used in the test, so another engineer can run it during an incident. Record any gaps found during the restore, such as missing ZooKeeper volumes or undocumented secrets, and assign fixes. Set a recurring restore test on your own schedule, since backups that have never been restored are unproven. If a major Langfuse upgrade is planned, repeat the test against the target version first. The step is done when the runbook is approved and the next restore test is on the team calendar.
How backups flow from each Langfuse data store
The diagram starts at Langfuse Web and Worker, which write to PostgreSQL, ClickHouse, Redis or Valkey and blob storage. Each stateful store has its own backup path: ClickHouse snapshots or BACKUP to S3, a pg_dump or volume snapshot for PostgreSQL, and a separate backup for SeaweedFS or MinIO only when you run that storage yourself. Redis or Valkey holds no data that needs a restore path. Check that every target is copied into a restore-test environment, because a backup you have never restored is not yet proven.
Each stateful Langfuse store has its own backup path into a restore test.
Security of backup copies and credentials
A backup is only as safe as the copies and credentials around it. Every backup of ClickHouse, PostgreSQL or blob storage holds the same personal data and prompt content as production, so it needs the same controls on where it lives, who can read it and who can restore it.
Encryption of backup copies
Backups of ClickHouse, PostgreSQL and blob storage contain trace content that may include personal data. Confirm that every backup target encrypts data at rest, that transfers use TLS, and that the encryption keys are held separately from the backups they protect. Check how each option you choose (volume snapshots, pg_dump files, ClickHouse BACKUP output) handles encryption, since the defaults differ. Ask your storage provider to document these settings in writing.
Backup strategiesAccess control on backup buckets
The bucket or volume that receives backups should grant write access only to the backup job and read access only to a small restore group. Avoid sharing the application's own storage credentials with backup tooling. Review bucket policies and object-level permissions after each change, and block public access. Confirm that deletion of backup objects requires a separate, logged permission.
S3 credentials used by ClickHouse BACKUP
ClickHouse BACKUP and RESTORE to S3 needs credentials that can write to a specific prefix. Scope these credentials to that prefix, use a dedicated identity rather than the Langfuse application identity, and rotate them on a schedule your security team sets. Store the keys in your secrets manager, not in manifests or shell history, and verify that a leaked key cannot read the production bucket.
Separation from the production account
Keep backup storage in a separate cloud account, subscription or project from the production Langfuse environment. A compromise or accidental deletion in production then cannot also remove the backups. Restrict who can administer the backup account and require separate approval for changes to its lifecycle rules. Confirm this design with your cloud architect before the first backup runs.
Retention aligned with data retention settings
Backups keep deleted data alive. If a project's retention policy removes traces after a window, the older backups may still hold those traces until they expire. Set backup retention with your privacy and legal teams, document the reasoning, and check that deletion requests can be honored in backups within the window you commit to. Add lifecycle rules so expired copies are removed automatically.
Secrets needed for restore
A restored database can be unreadable without the secrets that protect it. Keep copies of the SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY values in a vault with its own backup and access log, separate from the database backups. Record which secret version matches which backup, and test that a restore in a clean environment works with those secrets. Losing them can make the backup useless, while leaking them exposes the data.
Langfuse backup and restore questions buyers ask
What does a Langfuse backup project cost, and what drives the effort?
Effort is driven by how many data stores you back up, whether Langfuse runs on Kubernetes or a VM, whether PostgreSQL is managed or self-hosted, and how much ClickHouse data you hold. Each store needs its own method: a managed PostgreSQL service usually brings its own backup features, while a self-hosted one needs dumps or volume snapshots. ClickHouse needs snapshots or BACKUP to S3, and blob storage needs its own plan only if you run SeaweedFS or MinIO rather than a cloud object store. One-time costs cover design, scripts or CronJobs, and the first restore test. Recurring costs cover monitoring backup jobs, storage for backup copies, and retesting after upgrades. Ask any quote to list each store, the method, the retention period, and who runs the restore test. DeployOpen does not publish prices; a quote follows from the written scope.
How long does Langfuse backup setup and a restore test take?
Duration depends on the same factors as cost: the number of stores, the deployment model, the data volume, and how much access your teams can grant quickly. A restore test is the step most often underestimated, because it needs a separate environment large enough to load a copy of the data and confirm that Langfuse starts and shows the expected traces. Ask the provider for a written timeline that separates design, build, the first backup run, and the restore test, and ask what each phase depends on from your side. Timing for a specific environment should come from that scoped plan rather than from general estimates.
What does the work need from our team?
Expect to provide access and decisions rather than hands-on operation. Typical inputs include cloud accounts or data center access, one or more storage buckets with versioning or lifecycle settings you approve, credentials with the minimum permissions for each store, the backup schedule and retention you require, and a non-production environment where restores can be tested without touching live data. Confirm with your security team how backup credentials are stored and rotated, and who may read backup copies, since they contain the same trace data as production. Also confirm which team owns alerts when a backup job fails.
Can our own team set up Langfuse backups without a partner?
Yes, if your team already runs PostgreSQL, ClickHouse and object storage in production and can test restores. The hard parts are not the commands but the coordination: ClickHouse backups must be consistent across replicas and any ZooKeeper volumes, PostgreSQL backups must match the retention you promise, and restores must be rehearsed. Teams without recent restore experience on ClickHouse often find that the first real test takes longer than the setup. A partner is useful when you want a fixed-scope build with a written restore test, or when you need the evidence in a form your auditors can review. Decide based on your skills with each store and your change calendar.
Can Langfuse exports replace backups?
No. Exports to blob storage are intended for analytics and long-term archiving, and Langfuse warns that they should not be used as the restore path for a ClickHouse database. An export is a copy of selected observations and scores in a different format, so it cannot rebuild the full state of projects, users, prompts, configuration and database tables. A real backup captures the data store itself and can be restored into a working Langfuse. Keep both if you need archives for analysis and recoverability for operations, and document which one you would use in an incident. The details of the export format are covered in the scheduled export topic.
How do backups change during a major Langfuse upgrade?
Take a fresh, verified backup of every store immediately before a major upgrade, because the data model changes. Langfuse says updates within a major version apply database migrations automatically at startup, but major upgrades follow dedicated migration guides. The v3 to v4 guide, for example, requires ClickHouse 25.12 or later, PostgreSQL 15 or later and Redis 7.0 or later, moves to an observations-first ClickHouse data model, and advises about 3x ClickHouse disk headroom when backfilling historic data. Your backup plan should therefore cover the disk space needed for a rollback copy, the restore procedure for the older version, and the ClickHouse version that the backup must restore into. Confirm these points against the upgrade guide for your exact versions before you start.
Do we need backups for blob storage as well as the databases?
It depends on where your blob storage lives. Langfuse states that SeaweedFS or MinIO backups matter only for deployments that do not use cloud object storage such as Amazon S3, Azure Blob Storage or Google Cloud Storage. If you use a cloud bucket, confirm the provider's versioning, replication and retention options and whether they meet your recovery targets. If you run SeaweedFS or MinIO yourself, plan a separate backup for its volumes or buckets and test restoring it along with the databases, because media attachments and stored objects are part of the recoverable state.
How DeployOpen scopes and tests Langfuse backup and restore
DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside the client's own infrastructure, including their cloud accounts, data centers and air-gapped networks. For Langfuse backup and restore, that means the engagement covers the ClickHouse, PostgreSQL and, where it applies, SeaweedFS or MinIO blob storage that hold trace and prompt data in your environment, and it does not stop at a scheduled job. Most engagements are fixed-scope, so the list of stores, backup methods, retention windows, restore runbooks and restore tests is agreed in writing before work starts, and the written scope is what sets the quote.
Scoping starts with an inventory the reader can check: which data stores exist, where each one runs, whether PostgreSQL is a managed service, whether ClickHouse runs on Kubernetes with ZooKeeper volumes, and whether blob storage is cloud object storage or a self-hosted S3-compatible service. Those answers decide which backup method applies to each store and which of them need their own restore drill. The written scope should also name the recovery targets your organization has agreed to, who approves a restore, and whether a restore is tested into an isolated environment. Testing covers a full restore of each store, a check that the Langfuse Web and Worker containers come back consistent with the restored data, and a documented record of the result.
Ongoing support is available as a retainer. Typical retainer work for backups includes monitoring backup job results, rotating and re-testing restores after Langfuse or ClickHouse version changes, and reviewing backups again before a major upgrade. Ask any provider to state in the written scope which of these are included, how often restore tests repeat, and what happens when a backup fails outside working hours.

