Back up and restore a Dokku application's configuration, persistent storage, and (via service plugins) its datastores. Use when snapshotting an app before a risky change, migrating an app to another Dokku host, capturing config for disaster recovery, or restoring any of these. Note there is no single `dokku backup` command — a full backup is a composed procedure. Targets Dokku 0.37.x.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dokku-devsecops-skills:dokku-backup-restoreThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Version:** Dokku 0.37.x. **Safety:** the export/list steps are read-only; `config:import`, `storage:mount`, and datastore `:import` **overwrite live state** — confirm before restoring. Exported config and DB dumps contain secrets — store them encrypted.
Version: Dokku 0.37.x. Safety: the export/list steps are read-only; config:import, storage:mount, and datastore :import overwrite live state — confirm before restoring. Exported config and DB dumps contain secrets — store them encrypted.
There is no single
dokku backupcommand. A complete backup is composed from three parts: (1) config/env, (2) persistent storage, (3) datastore services. Capture all three.
# Back up
dokku config:export <app> > <app>.env # or:
dokku config:bundle <app> > <app>-env.tar # tarball form
# Restore
dokku config:import <app> < <app>.env # merge
dokku config:import --replace <app> < <app>.env # replace
dokku storage:list <app> # read-only: shows host-dir:container-dir mounts
dokku storage:report <app>
The data lives in the host directories shown by storage:list (typically under /var/lib/dokku/data/storage/<app>). Backing them up is a host-filesystem operation (outside the dokku CLI, usually needs root):
sudo tar czf <app>-storage.tgz /var/lib/dokku/data/storage/<app> # confirm path from storage:list
Restore = place files back on the host and (re)create the mount:
dokku storage:mount <app> /var/lib/dokku/data/storage/<app>:/data # confirm
Host-filesystem access requires root/sudo and is outside Dokku itself — coordinate with whoever owns the host (verify exact paths via
storage:listfirst).
Database/service data is not in the app — it lives in a Dokku service plugin (postgres, mysql, redis, …). Each official datastore plugin provides :export/:import:
# Example (MySQL service plugin):
dokku mysql:export <service> > <service>.sql # back up
dokku mysql:import <service> < <service>.sql # restore (overwrites — confirm)
Check which service plugins exist (dokku plugin:list) and use that plugin's own :export/:import. Command names vary per plugin — confirm with dokku <service>:help.
The app's shape (builder, ports, domains, checks, resources) is captured by the reports in dokku-app-audit, or ideally lives in version control as a Dockerfile + app.json. Re-create the app on a new host by deploying the same source (see dokku-deploy-dockerfile) and re-importing config + storage + datastore.
config:import the environment.storage:mount.:import.dokku ps:report + dokku logs + a real request.npx claudepluginhub shooding/dokku-devsecops-skills --plugin dokku-devsecops-skillsProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.