Dokploy Server Cleanup
Guided cleanup chain to reclaim disk space. Always reports current usage first, then walks through each cleanup operation with explicit user confirmation.
Use this when builds start failing with no space left on device, deploys silently time out, or settings-getDockerDiskUsage reports >90% utilisation.
Arguments
Format: [--dry-run] (optional)
--dry-run— show what would be cleaned without actually executing any destructive operation.
Parse from "$ARGUMENTS".
Process
Report current state:
mcp__plugin_dokploy-dev_dokploy__settings-getDockerDiskUsageIt returns one row per category (
type,totalCount,active,size,reclaimable,sizeBytes) for Images, Containers, Local Volumes and Build Cache. Show:- Per-category size and reclaimable space (read
reclaimable— it tells you which step is worth running) - Host disk used / total: on v0.30+ call
mcp__plugin_dokploy-dev_dokploy__docker-getServerHealthand readdisk.usedBytes/disk.totalBytes - Top 5 largest images / volumes (v0.30+:
dockerImage-getImages,dockerVolume-getVolumesSize) - For a remote server pass
serverIdto thedockerDiskUsage-*/docker-getServerHealthtools; thesettings-clean*tools below (exceptcleanMonitoring) accept an optionalserverIdtoo
- Per-category size and reclaimable space (read
Walk through cleanup operations in this order. Confirm each with the user (unless
--dry-run):Step Tool What it does Risk a mcp__plugin_dokploy-dev_dokploy__settings-cleanDockerBuilderClears the Docker BuildKit cache None — only cache b mcp__plugin_dokploy-dev_dokploy__settings-cleanStoppedContainersRemoves containers in exitedstateNone — already stopped c mcp__plugin_dokploy-dev_dokploy__settings-cleanUnusedImagesRemoves images not currently used by any container Low — images can be rebuilt d mcp__plugin_dokploy-dev_dokploy__settings-cleanUnusedVolumesRemoves volumes not attached to any container Medium — destroys data. Confirm explicitly; orphan volumes can still contain DB files e mcp__plugin_dokploy-dev_dokploy__settings-cleanDockerPruneEquivalent to docker system pruneLow — combination of a-c f mcp__plugin_dokploy-dev_dokploy__settings-cleanMonitoringRemoves monitoring data None Skip step
dunless the user explicitly opts in.Report final state:
- Re-run
settings-getDockerDiskUsageand show the delta in plain language ("Reclaimed 12.4 GB").
- Re-run
Configure log cleanup automation (optional):
mcp__plugin_dokploy-dev_dokploy__settings-getLogCleanupStatus— show current schedule.- Offer to enable / tune via
settings-updateLogCleanupif disk pressure was caused by log accumulation.
When to stop
If cleanDockerBuilder + cleanUnusedImages reclaim less than 5% disk, the bottleneck isn't Docker. Check:
- Big application volumes (databases that grew unbounded).
/etc/dokploy/logs/accumulation —getLogCleanupStatuswill show if rotation is off.- The host filesystem outside Docker (
/var/log, large user files).
In that case, escalate: ssh to the server and run du -sh /var/lib/docker /etc/dokploy /var/log.
Example Usage
/dokploy-dev:cleanup
/dokploy-dev:cleanup --dry-run