How to back up Ghost in Docker (2026)
A complete Ghost backup has three parts: dump its MySQL and SQLite databases the correct way, capture the 2 data volumes that hold files on disk, and save the compose file and .env. Dockstash detects all three automatically, dumps the database from the running container, and restics everything off-site.
What Ghost stores
| Compose services | ghost, mysql |
|---|---|
| Databases detected | mysql, sqlite |
| Data volumes | ghost_content (/var/lib/ghost/content), db_data (/var/lib/mysql) |
| Config paths | docker-compose.yml, .env, config.production.json |
The backup plan
- Dump the database. For a MySQL-backed Ghost, run mysqldump --single-transaction. For the SQLite default, use sqlite3 ".backup" on the content/data/ghost.db file through the online backup API.
- Capture the content directory. Restic the ghost_content volume: images, themes, and member data under /var/lib/ghost/content live outside the database.
- Capture compose and config. Restic docker-compose.yml, .env, and config.production.json so mail, URL, and database settings are preserved.
Restoring Ghost
Restore the database dump to staging, then restore the content directory so image references resolve. If using SQLite, replace ghost.db while Ghost is stopped to avoid WAL races.
Back up Ghost in one click All guides
Last updated: July 2026
Related database guides
Frequently asked questions
Does Ghost use MySQL or SQLite?
Both are supported. Production Ghost typically uses MySQL; smaller installs default to SQLite. Dockstash detects which is configured and dumps it the correct way — mysqldump or sqlite3 ".backup".
What is in the Ghost content directory?
Uploaded images, installed themes, and member/media assets. It lives on disk separate from the database, so it must be backed up alongside the DB dump.
Can I copy the SQLite ghost.db while Ghost runs?
Not safely under WAL — you would miss the -wal sidecar and capture a torn file. Dockstash uses the SQLite online backup API instead.