Retention Rules
Retention rules help you automatically delete old content from repositories to keep storage and metadata clean over time.
What are retention rules?
A retention rule is a policy that RepoFlow periodically runs to delete content that matches criteria you define (for example, older artifacts).
Why you might need them
- Control storage growth: Automatically clean up outdated artifacts.
- Reduce clutter: Keep repositories focused on the versions you actively use.
- Operational hygiene: Prevent very old/unused artifacts from accumulating indefinitely.
Rule types
RepoFlow supports three retention rule types:
| Rule type | What it deletes | Notes |
|---|---|---|
| Package | Entire packages | This deletes the package and its versions. Use with care. |
| Package versions | Specific versions of a package | Recommended starting point for most use cases. |
| Files | Specific files | Disabled by default because it can break packages. Only use if you deeply understand RepoFlow’s file model and you really know what you’re doing. |
Screenshots
Create retention rule

Dry run

Enabling and configuration (self-host)
Retention rules are controlled by server environment variables. See Server Environment Variables for the full list.