What it cleans
Containers and images are cleaned only when free space falls below the disk budget (default 15%). Build cache, volumes and attempts are time driven and run every pass.
Pipeline artifacts already expire on their own retention (see pipelines), so they are not repeated here.
Preview and quarantine
- Preview (
janitor run --dry-run, or the Preview button) lists every candidate and changes nothing. - An orphaned volume is first quarantined: the pass records when it was first seen. It is deleted only when the quarantine (default 14 days) has ended, “Delete volumes after quarantine” is on, and it is still unused. At most 5 volumes are deleted per pass. A volume that becomes referenced again leaves quarantine. Disk pressure never changes this: with “Delete volumes after quarantine” off, unused anonymous volumes are kept and the run says they were skipped.
Run now and the disk alert
Run now does a forced pass: containers and images are cleaned even above the budget. When free space is below budget the page shows a warning with a “Clean up now” button, and the disk space fix in the Fixes list runs the same pass. Every pass that changes something is stored with the bytes it reclaimed.CLI
get_janitor returns the state and, with preview, a dry run.
API
GET /api/v1/system/janitor, GET /api/v1/system/janitor/runs, PUT /api/v1/system/janitor/policy and POST /api/v1/system/janitor/run?dry_run=true&force=true. Changing the policy and running need a root token.
Per-app image retention
Image cleanup, manual or scheduled, keeps the newest successful deploy images of each app. The global count is theimages.keep_per_app setting. An app can set its own count from Deploy settings, Safety, Image retention, or with:
app.image_keep, then images.keep_per_app) or 2 to 1000, so the previous successful release always stays as a rollback target. The dashboard runs a dry run first and shows the count, size and names of what the next cleanup would remove before it lets you save.
Whatever the count, the cleanup never removes the running image, a pinned rollback target, an image used by a container, an image more than one app references (such as a shared base image) or an image a queued, held or running deploy needs. An app in a protected environment cannot go below the global count. Changes and removals are written to the audit log.
API: GET and PUT /api/v1/apps/{name}/image-retention ({"keep": 5}), and POST /api/v1/apps/{name}/image-retention/preview for the dry run, which never deletes. Setting the count and the preview need a root token, the same as image cleanup.
Limits
- It cleans the control plane’s own node. Other nodes keep using the per-node build center and image tools.
- Disk free is measured on the control plane data directory.