dokku-audit is a Dokku community plugin that keeps a queryable history of deploys and operational changes on a Dokku host.
Use it when you want to answer questions like:
- Which app was deployed most recently?
- Was this a real source deploy or only a release/rebuild-style deploy?
- When did an app's config, domains, or ports change?
- Who invoked
dokku runordokku enterfor an app? - What happened on a single app over time?
dokku-audit runs on the Dokku host itself.
- Dokku must already be installed.
sqlite3is required.flockis recommended for migration locking. If it is missing, the plugin falls back to a directory-based lock.
On Ubuntu/Debian-based Dokku hosts:
sudo apt-get update
sudo apt-get install -y sqlite3 util-linuxNotes:
sqlite3is the hard dependency.flockis typically provided byutil-linux.- On many Dokku hosts
util-linuxis already installed, but installing it explicitly is harmless.
Quick verification:
command -v sqlite3
command -v flockInstall the plugin on the Dokku host:
dokku plugin:install https://github.com/pruvon/dokku-audit.gitAfter install, verify that everything is healthy:
dokku audit:status
dokku audit:doctorThe install process creates the plugin data directory and initializes the SQLite database automatically.
When you update the plugin, run:
dokku plugin:update audit
dokku audit:statusIf you want to run migrations manually:
dokku audit:migrateRemove the plugin from Dokku:
sudo dokku plugin:uninstall auditImportant:
- Uninstall does not delete the audit database automatically.
- Audit data is intentionally preserved.
- Dokku installs this repository under the plugin name
audit, so plugin lifecycle commands useaudit.
If you also want to delete stored audit data, remove it manually:
sudo rm -rf /var/lib/dokku/data/dokku-auditOnly do that if you are sure you no longer need the audit history.
Default paths:
- Data directory:
/var/lib/dokku/data/dokku-audit - Database:
/var/lib/dokku/data/dokku-audit/audit.db - Backups:
/var/lib/dokku/data/dokku-audit/backups
- App create, destroy, and rename events
- Selected Dokku command invocations recorded through
user-auth, with actor attribution, target app extraction for supported app-scoped commands,SSH_USER/SSH_NAMEcapture, best-effort SSH key fingerprint lookup, noisy read-only polling/report commands skipped, and commands with richer structured follow-on events represented by those follow-on events instead of a duplicatedokku_commandrow - Source receipt plus final deploy completion events; intermediate Dokku source-stage hooks are used to enrich the final deploy record without adding extra timeline noise
- Structured
dokku runanddokku enterevents, including actor and target container/process context when Dokku exposes it - Follow-on app events inherit the triggering actor and Dokku command when the preceding command can be matched confidently
- Structured certificate-management command events plus certificate install/remove follow-on events for
certs:*andletsencrypt:*flows - Config changes with value redaction, excluding known Dokku-managed deploy bookkeeping keys such as
GIT_REV,DOKKU_APP_TYPE, andDOKKU_APP_RESTORE - Domain changes
- Port changes
- Maintenance events like migration, backup, vacuum, and prune
Deploy completion is classified as either source_deploy or release_only.
source_deploy:post-deployhappened with preceding source intake/build context. In practice this usually covers real source-backed deploy flows such asgit push,git:sync, archive/image source imports, anddokku ps:rebuild.release_only:post-deployhappened without preceding source intake/build context. In practice this usually covers restart or release-style flows that reuse the existing built image, such asdokku ps:restart, plus config-driven restart/redeploy flows.
dokku audit: Shortcut fordokku audit:status.dokku audit:status: Shows whether the plugin is installed correctly and whether the database is reachable. Good first command after install.dokku audit:doctor: Runs deeper checks. Use this whenstatuslooks wrong or when you suspect DB/config problems.dokku audit:migrate [--dry-run] [--verbose]: Applies unapplied schema migrations. Use--dry-runto preview changes and--verbosefor more detail.dokku audit:last-deploys [--limit N] [--app APP] [--classification VALUE] [--format table|json|jsonl] [--quiet]: Shows the most recent completed deploy events. Use--app APPto scope to one app,--classification source_deployor--classification release_onlyto focus on one deploy class, and--formatfor machine-readable output.dokku audit:timeline <app> [--limit N] [--since ISO8601] [--until ISO8601] [--category VALUE] [--format table|json|jsonl] [--quiet]: Shows the event history for one app. Use--formatto switch output style.dokku audit:recent [--limit N] [--category VALUE] [--classification VALUE] [--status VALUE] [--since ISO8601] [--format table|json|jsonl] [--quiet]: Shows recent events across all apps. In table output, actor labels are normalized asssh-key:<label>,ssh-user:<user>,sudo-user:<user>,unix-user:<user>, ordokku-system. Use--formatfor JSON or JSONL output.dokku audit:show <event-id> [--format table|json]: Shows full details for one event. Use it afterlast-deploys,timeline, orrecentwhen you need more context.dokku audit:search --query TEXT [--app APP] [--limit N] [--format table|json|jsonl] [--quiet]: Searchesmessageandmeta_jsonfor free-text matches. Use--queryto specify the search term and--appto scope to one app.dokku audit:export [--format jsonl|json|csv] [--app APP] [--since ISO8601] [--until ISO8601] [--output PATH]: Exports events as JSON, JSONL, or CSV. Use--appto scope to one app,--since/--untilto bound the time range, and--outputto write to a file.dokku audit:backup [--output PATH]: Creates a safe SQLite backup of the audit database. Recommended before major upgrades or cleanup.dokku audit:vacuum: Runs SQLite maintenance. Useful after heavy pruning or long-term use.dokku audit:prune --older-than DAYS [--category VALUE] [--classification VALUE] [--yes]: Deletes old events intentionally. Use carefully; this is the cleanup command.dokku audit:prune-backups --older-than DAYS [--yes]: Deletes old SQLite backup files from the backup directory. Use it to prevent backups from accumulating indefinitely.dokku audit:get <key>: Reads a plugin runtime configuration value from the database. Use it to inspect settings such asbusy_timeout_msorstrict_mode.dokku audit:set <key> <value>: Stores a plugin runtime configuration value in the database. Overrides environment variable defaults. Examples:dokku audit:set strict_mode true,dokku audit:set deploy_metadata_max_bytes 2048.
Show recent deploys:
dokku audit:last-deploysShow recent deploys for one app:
dokku audit:last-deploys --app myappShow only source-backed deploys such as git push or dokku ps:rebuild:
dokku audit:last-deploys --classification source_deployShow only restart or release-style deploys such as dokku ps:restart:
dokku audit:last-deploys --classification release_onlyShow one app timeline:
dokku audit:timeline myappShow recent config-related changes across the host:
dokku audit:recent --category configInspect one event in detail:
dokku audit:show 42Export one app's events as JSON:
dokku audit:export --app myapp --format json --output /tmp/myapp-audit.jsonCreate a backup:
dokku audit:backupPrune old maintenance events:
dokku audit:prune --older-than 180 --category maintenance --yesPrune old backup files:
dokku audit:prune-backups --older-than 30 --yesSearch for events containing a specific string:
dokku audit:search --query "error"Search within one app:
dokku audit:search --query "deploy" --app myappRead a runtime setting:
dokku audit:get strict_modeStore a runtime setting:
dokku audit:set strict_mode trueQuery commands support:
- table output by default
--format json--format jsonl
Examples:
dokku audit:last-deploys --format json
dokku audit:recent --format jsonl
dokku audit:timeline myapp --format json- Config values are never stored from
post-config-update. - Only config key names are recorded.
- General command audit redacts
config:setvalues anddokku run --envvalues before storing command metadata. - Deploy source metadata is stored conservatively: sensitive
key=valuepairs are redacted and oversized payloads are truncated before insert. - Internal follow-on events store the sanitized triggering Dokku command when actor propagation is possible.
- If you see
ssh-key:default,defaultis the DokkuSSH_NAMElabel attached to the matching key, not a Unix username. - If a Dokku command is run locally via
sudo, follow-on events and maintenance events can attribute it assudo-user:<user>fromSUDO_USER. - If a command runs locally without SSH and without
sudo, top-level maintenance commands can fall back tounix-user:<user>from the local process environment or process tree. - When Dokku exposes only the low-signal fallback label
SSH_NAME=default, a meaningful local Unix user discovered from the process environment or process tree can be preferred for display and actor attribution while the original SSH metadata is still kept in JSON. dokku-systemmeans Dokku triggered the event internally and no user/key identity was available at that trigger point.user-authcommand audit keeps actor attribution for meaningful commands but skips noisy read-only commands such asaudit:*,logs,config,*:list,*:links,*:app-links,*:report,*:info,*:show,*:exists,--version, andps:retire.- Audit failures are best-effort by default and should not break successful Dokku app operations.
- The database is intended to remain host-local.
- Direct
docker execaccess bypasses Dokku triggers, so it is not visible to this plugin.
Create a backup:
dokku audit:backupRestore manually:
- Stop concurrent writes if possible.
- Replace the database file with a backup copy.
- Re-apply expected permissions.
- Run
dokku audit:doctor.
Run the shell test suite:
./tests/run.sh