Linux

Where Does Self-Hosted Monica Store Data?

Monica keeps uploads and caches in /var/www/html/storage with relationships in MySQL. Env carries keys and DB wiring.

Last updated

Monica splits into volume, env, and database. The /var/www/html/storage volume holds uploads, caches, and generated files. Env carries APP_KEY, APP_ENV, and DB_* connection values. Contacts, journals, vaults, and reminders live in MySQL/MariaDB. Docker examples mount the storage volume with a linked database container.

APP_KEY is the load-bearing secret: encrypted fields never decrypt without the exact key, so reinstalls must reuse it. The v3 rebuild (in beta alongside 4.x stable) keeps self-hosting but reshuffles layout; follow your branch docs. Expose with APP_ENV=production and a proxy; the app mandates HTTPS scheme in that mode.

Where Monica stores this, by platform

Linux
/var/www/html/storage (volume)

Uploads, caches, generated files. Mount persistently. Pair with the MySQL dump and env record; APP_KEY must match the dump or encrypted fields stay locked.

Frequently asked questions

how do i back up monica crm

Copy the storage volume plus a MySQL dump plus your env record (APP_KEY especially) with containers stopped. Contacts, journals, and files span both; the key decrypts stored values. Restore all three to matching paths.

which monica env vars matter most

Generate a base64 32-byte key once and keep it with backups; losing it against a kept database locks encrypted fields. Set APP_ENV=production for internet exposure (forces HTTPS scheme). DB_* vars wire MySQL; storage volume holds the rest.

Notice an outdated path? Let us know.