Server cleanup

Docker cleanup, reclaiming disk on a server. One schedule for the instance, individual hosts opt out.

Reclaiming disk. This is the setting people wish they had found earlier.

Settings -> Servers -> the server -> Cleanup. One schedule for the whole instance, and individual hosts opt out of it with the Scheduled cleanup switch in that card's header, so a server you add tomorrow can never silently go unswept. The checkbox below it turns the whole thing off instance-wide.

It ships on, with all seven scopes enabled, a nightly 0 4 * * * schedule, a 24-hour minimum age and one image kept per app. A new scope added by a later release enables itself on a policy you have already saved.

What gets cleaned

Prop

Type

Every scope judges against what this Deplo still knows about, so a live app keeps its images, files and network even while it is moving between servers, and a stopped app keeps everything.

Unused app images and the build cache are also swept right after every deploy, so a day of builds cannot fill the disk before the schedule fires.

The build cache also has a ceiling: a tenth of the server's disk. Past that, the oldest cache is evicted even when it is younger than the minimum age. Without it, a host that builds all day never has a cache old enough to qualify, and the ceiling is the only thing that still bites.

Settings

Prop

Type

What it deliberately never does: system prune, container prune, volume prune, network prune. A container and anything a container still uses are never touched, because on a Deplo host a stopped app is a live app. A named volume goes only when it is one of your apps' and is empty: no bytes, nothing to lose. Anything with data in it stays, whatever its name.

What cleanup does not touch

  • Cleanup and rollbacks fight over the same images. If rollbacks stop working, Images kept per app is too low for the app's Keep.
  • This is not what frees the disk after you delete something. Cleanup reclaims images, caches and the directories of apps that are gone. It never touches a named volume, and it never touches a server folder an app reached through a Bind - those are yours to remove.
  • A pulled image comes back with the next deploy. Removing one costs a pull, never data. Untick Unused pulled images on a server without registry access.
  • Backup files are not on this list either. Deleting a backup schedule leaves the copies it already made in the destination.
  • A migration source is never swept, scheduled or on demand. That machine is somebody else's platform until you are done with it.

Troubleshooting

SymptomWhat to check
Cleanup frees nothingThe build cache is already under its ceiling and the minimum age is protecting the rest, or the only large thing on disk is images your apps still use.
Reclaim disk now ran on a host you opted outIt does: the manual run ignores the opt-out list. The schedule honours it.
Rollbacks stopped working after a sweepImages kept per app is too low for an app that cannot roll back. For apps that can, their own Keep governs.

More in Servers and agents.

Next steps

Did this page help you?

On this page