Artifactory does not automatically delete stored binaries unless specific retention policies are configured. Regularly cleaning out artifacts that haven't been accessed for a significant period can save considerable storage space. The recommended approach for automating this cleanup is now through dedicated Artifactory workers, replacing older user plugins.
For general artifact cleanup across most repository types, the Artifact Cleanup Worker can be used. Its primary function is to delete artifacts based on their last download date, removing files that haven't been accessed within a configured time period (e.g., older than 'x' days or months). This worker is triggered via a worker event, typically using the JFrog CLI, and offers a dryRun mode for safe testing.
Note
This general worker is not suitable for Docker repositories.
For Docker images, the specialized Artifactory Clean Docker Images Worker is the recommended solution. This worker cleans Docker repositories based on policies defined directly on the images themselves using standard Docker labels. You can set policies to limit the age of images (maxDays) or the number of versions retained (maxCount). This worker is also executed via a worker event using the JFrog CLI and allows cleanup based on image creation or download dates, along with a dryRun capability.