Linux

Where Does Self-Hosted Dify Store Data?

Self-hosted Dify keeps app data in Postgres, vector extensions, Redis, and a storage volume. The compose project names every volume.

Last updated

Dify's Docker deployment is a small fleet: Postgres for app state, a vector database for embeddings, Redis for jobs and cache, and a storage volume for uploaded files and models. Each persists in a named Docker volume under the compose project, so exact names come from your compose file.

The vector store choice changes which volume matters most. Weaviate, Qdrant, and Milvus variants each mount their own data path, and the docs per variant list them. Secrets and API keys live in environment files beside the volumes. Back up both halves together or restores authenticate against nothing.

Where Dify stores this, by platform

Linux
/var/lib/docker/volumes/[project]_db-data

Postgres, vector store, Redis, and file storage volumes under the compose project. Check volume names in your compose file. Keep the env file with secrets alongside volume snapshots.

Frequently asked questions

What belongs in a Dify backup?

Snapshot the Postgres volume, the vector store volume, Redis persistence, and the storage volume together with the stack stopped. Apps reference datasets across all four, so partial backups restore broken workspaces.

Do volumes survive version upgrades?

Yes across minor releases, with the migration container handling schema moves. Read the release notes for breaking storage changes first. Snapshot volumes before upgrading so rollbacks stay possible.

Notice an outdated path? Let us know.