Linux

Where Does Self-Hosted Twenty Store Data?

Twenty keeps records in Postgres with uploads in server-local-data. Env carries secrets; volumes carry everything else.

Last updated

Twenty splits into four containers: server, worker, Postgres, Redis. Records live in the db-data Postgres volume, uploaded files in server-local-data under the server package path, cache and jobs in Redis. Secrets (ENCRYPTION_KEY, APP_SECRET, DB passwords, server URL) arrive as env. Compose files in the repo wire identical mounts across examples.

The encryption key is the load-bearing piece: generated once, backed up with data, never rotated casually. Migrations run in server startup (disable flags exist for worker-only roles), so version jumps need the migrator to complete before traffic. Old spilo-based Postgres images are deprecated; follow current compose with stock Postgres 16 for new installs.

Where Twenty stores this, by platform

Linux
server-local-data (.local-storage)

Uploaded files under the server package path. Mount persistently on server and worker alike. Pair with the Postgres dump and env record; files without rows are orphans.

Linux
db-data (Postgres volume)

Records, relations, and secrets in Postgres 16. Dump on schedule. Deprecated spilo images should migrate to stock Postgres; keep ENCRYPTION_KEY with every dump.

Frequently asked questions

how do i back up twenty crm

Copy the db-data volume (dump Postgres too) plus server-local-data plus your env record with the stack down. Records, files, and encrypted secrets span all three. Rotate ENCRYPTION_KEY only deliberately; losing it locks stored secrets.

which twenty env vars must i keep

Generate it once and store it with backups; without it encrypted fields never decrypt. Server URL must match browser access or sessions break. Postgres plus Redis plus env plus volumes is the full state; the compose file alone restores nothing.

Notice an outdated path? Let us know.