Getting Started¶
This guide walks you through deploying Deleterr and running your first cleanup.
Prerequisites¶
Before starting, ensure you have:
- [ ] Plex Media Server with a valid token (how to get token)
- [ ] Radarr and/or Sonarr with API keys
- [ ] Docker installed on your system
- [ ] (Optional) Tautulli installed and configured with API key - if not configured, Plex API is used for watch history
Docker Compose Setup¶
There are two ways to schedule Deleterr: using the built-in scheduler (recommended for simplicity) or an external scheduler like Ofelia.
The simplest setup - Deleterr handles its own scheduling:
version: "3.9"
services:
deleterr:
image: ghcr.io/rfsbraz/deleterr:latest
container_name: deleterr
environment:
LOG_LEVEL: INFO
volumes:
- ./config:/config
- ./logs:/config/logs
restart: unless-stopped
Add to your settings.yaml:
For more advanced scheduling control, use Ofelia:
version: "3.9"
services:
deleterr:
image: ghcr.io/rfsbraz/deleterr:latest
container_name: deleterr
environment:
LOG_LEVEL: INFO
volumes:
- ./config:/config
- ./logs:/config/logs
restart: no
scheduler:
image: mcuadros/ofelia:latest
container_name: scheduler
depends_on:
- deleterr
command: daemon --docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped
labels:
ofelia.job-run.deleterr.schedule: "@weekly"
ofelia.job-run.deleterr.container: "deleterr"
Create settings.yaml¶
Create config/settings.yaml with your configuration. Start with dry run enabled:
dry_run: true # Preview changes without deleting
plex:
url: "http://plex:32400"
token: "YOUR_PLEX_TOKEN"
# Tautulli is optional. If it is not configured, Tracearr is used when
# configured, otherwise the Plex API is used for watch history.
tautulli:
url: "http://tautulli:8181"
api_key: "YOUR_TAUTULLI_API_KEY"
# Optional alternative to Tautulli (requires Tracearr 2.0+). Used only when
# tautulli above is omitted. See docs/integrations/tracearr.md.
# tracearr:
# url: "http://tracearr:3000"
# api_key: "trr_pub_YOUR_TRACEARR_API_KEY"
# server_name: "Plex"
radarr:
- name: "Radarr"
url: "http://radarr:7878"
api_key: "YOUR_RADARR_API_KEY"
libraries:
- name: "Movies"
radarr: "Radarr"
action_mode: "delete"
last_watched_threshold: 90
added_at_threshold: 180
Start the Stack¶
Scheduling Options¶
Built-in Scheduler¶
The built-in scheduler supports presets and standard cron expressions:
| Schedule | Value |
|---|---|
| Weekly (Sunday 3am) | weekly |
| Daily at 3am | daily |
| Hourly | hourly |
| Monthly (1st at 3am) | monthly |
| Custom cron | 0 3 * * 0 (Sunday 3am) |
Example configuration:
scheduler:
enabled: true
schedule: "0 4 * * 1,4" # Monday and Thursday at 4am
timezone: "Europe/London"
run_on_startup: true # Also run when container starts
If the scheduler process stays running while the host sleeps, a delayed cleanup can catch up within six hours of its scheduled time. Multiple overdue executions are combined into one cleanup, and cleanups never overlap. A run beyond that window, or one skipped because an earlier cleanup is still running, is logged in Deleterr's own log, recorded as failed in the last-run file and sent to configured failure-notification providers. The scheduler continues waiting for future runs.
The schedule is kept in memory: this catches up a sleeping process, but does not replay schedules from before a container restart. Use run_on_startup: true when a cleanup on container startup is wanted.
After every scheduled run, the scheduler writes /config/.deleterr_last_run.json with the status (success, partial when some libraries failed, or failed), a timestamp, the error if any (API keys and tokens are redacted), libraries_processed, libraries_failed, items_deleted, items_tagged (items newly added to leaving soon), interval_seconds, last_success_at and dry_run. items_deleted counts only real deletions, so a dry run records zero. When the scheduler starts, and before the first run, the file is written with status set to starting. A fatal startup error, such as invalid YAML, is recorded as failed before the process idles. Crashed runs also send a failure notification to your configured providers, and partial runs list the failed libraries in the run summary.
The published Docker image includes a HEALTHCHECK that reads this file. The container is unhealthy when the last run status is failed, or when the last successful run is older than twice the schedule interval (for starting, the last success is used when one exists). The interval is the longest gap in the schedule, so a cron such as * 3 * * * uses the overnight wait, not the one-minute burst, and a yearly or half-year cron uses the full idle gap. Set DELETERR_HEALTH_MULTIPLIER to change the multiplier. For --run-once or an external scheduler such as Ofelia, disable the check in Compose (healthcheck: disable: true) or set DELETERR_HEALTHCHECK=0. The script uses only the Python standard library and the same file can be read by a dashboard or an external check.
Ofelia (External Scheduler)¶
If using Ofelia, common scheduling patterns:
| Schedule | Label Value |
|---|---|
| Weekly (Sunday midnight) | @weekly |
| Daily at 3am | 0 3 * * * |
| Every 6 hours | @every 6h |
| Monthly | @monthly |
See Ofelia documentation for full syntax.
Portainer Deployment¶
When deploying with Portainer, you may encounter bind mount errors because Portainer doesn't auto-create host directories.
In Portainer CE 2.19+: Stacks > Add stack > Advanced options > Enable "Create path on host if it doesn't exist"
Then use absolute paths in your stack.
First Run Walkthrough¶
- Start with dry_run: true - This logs what would be deleted without actually deleting
- Check logs - Review
logs/deleterr.logto see what media would be affected - Adjust thresholds - Modify
last_watched_thresholdandadded_at_thresholdbased on results - Add exclusions - Protect important media with exclusion rules
- Disable dry_run - Set
dry_run: falsewhen satisfied with the preview - Enable scheduling - Let Deleterr run automatically
Verifying Configuration¶
Run Deleterr once manually to verify your setup:
Check the logs for:
- Successful connections to Plex, Radarr/Sonarr, and Tautulli (if configured)
- Watch data provider selection (Tautulli or Plex)
- Media items identified for deletion
- Any errors or warnings
Next Steps¶
- Configuration Reference - Full list of all settings
- Templates - Ready-to-use configuration examples
- Leaving Soon - Set up user notifications before deletion