Keep your Plex libraries clean — automatically, safely, and visibly.
ShelfLife is a self-hosted tool that automatically maintains Plex libraries using rule-based automation. It features a fully managed form-based UI with no manual configuration or .env files required.
- Rule-Based Cleanup Engine: JSON-based condition and action system
- Form-Based Rule Builder: Intuitive UI for creating rules without technical knowledge
- Plex Integration: Full library management, collection handling, and metadata editing
- Radarr & Sonarr Integration: Seamless deletion via *arr services
- Safety Features: Keep collections, dry-run mode, watched-again protection
- Modern Web Dashboard: React + Vite + Tailwind CSS with search and filtering
- Search & Filter: Powerful search and filtering on candidates page by title, rule, or type
- Multi-language Support: English and German
- Automated Scheduling: Background scans and delayed action execution
- Clone the repository:
git clone <repository-url>
cd ShelfLife- Build and run:
docker-compose up -d- Access the web interface at
http://localhost:8000
Prerequisites: Python 3.11 or 3.12 recommended for best compatibility
- Install Python dependencies:
cd backend
python -m pip install --upgrade pip
pip install -r requirements.txtTroubleshooting: If you encounter Rust compilation errors (especially with cryptography):
- Restart your terminal/PowerShell - Rust may need to be on PATH
- Or install cryptography separately with pre-built wheels:
pip install --only-binary :all: cryptography
- See
backend/INSTALL.mdfor more detailed installation instructions
- Run the server:
python main.pyOptional environment variables for manual runs:
UVICORN_HOST(default127.0.0.1)UVICORN_PORT(default8000)
For example, to expose the API externally while developing:
export UVICORN_HOST=0.0.0.0
export UVICORN_PORT=8080
python main.pyDocker deployments typically set these automatically, so most container users don't need to configure them manually.
- Install Node.js dependencies:
cd frontend
npm install- Run the development server:
npm run dev- Access the frontend at
http://localhost:3000
- Launch container → access web dashboard
- Enter Plex URL + Token (optional: Radarr/Sonarr)
- Import Plex libraries
- Create rules via the form-based builder
- Run a dry-run scan → review results
- Enable actions when satisfied
All credentials are encrypted and stored locally in SQLite.
The candidates page shows all items scheduled for removal based on your rules. It includes:
- Search: Search candidates by item title, show title, or rule name
- Rule Filter: Filter candidates by specific rule
- Type Filter: Filter by movies or seasons
- Quick Actions: Add items to collections directly from the candidates list
- Detailed Information:
- For seasons: Show title, season title, episode count, last watched episode details
- For movies: Title, rule, scheduled date, and actions
Use the search and filter tools to quickly find specific candidates or review items from particular rules.
GET /api/health- Health checkGET /api/settings/POST /api/settings- System settingsPOST /api/settings/test- Test Plex connectionPOST /api/settings/test_radarr- Test Radarr connectionPOST /api/settings/test_sonarr- Test Sonarr connectionGET /api/libraries/POST /api/libraries/import- Library managementGET /api/rules/POST /api/rules/PUT /api/rules/{id}/DELETE /api/rules/{id}- Rule managementPOST /api/tasks/scan/POST /api/tasks/scan/{rule_id}- Trigger scansGET /api/candidates- View candidates for deletionGET /api/logs- View action logs
- Dry-run by default: All new rules start in dry-run mode
- Keep collection override: Items in "Keep", "Favorites", or "Behalten" collections are protected
- Watched-again protection: Cancels pending deletions if item is watched again
- Delayed deletions: All deletions require a delay period
- Comprehensive logging: Full audit trail of all actions
- Backend: Python + FastAPI
- Frontend: React + Vite + Tailwind CSS
- Database: SQLite
- Scheduler: APScheduler
- Integrations: plexapi, Radarr v3 API, Sonarr v3 API
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter errors installing dependencies, especially related to Rust/cryptography:
- Ensure you're using Python 3.11 or 3.12 (better wheel support)
- Upgrade pip:
python -m pip install --upgrade pip - Restart your terminal/PowerShell after Rust installation
- See
backend/INSTALL.mdfor detailed troubleshooting
If the Docker build fails:
- Ensure Docker has enough memory allocated
- Try building without cache:
docker-compose build --no-cache
Comprehensive documentation is available in the docs/ folder:
- Documentation Index - Start here for documentation overview
- Installation Guide - Detailed installation instructions
- User Guide - Complete guide to using ShelfLife
- API Documentation - REST API reference
- Contributing Guide - How to contribute to ShelfLife
- Translations Guide - How to add new languages
- Architecture - Technical architecture and design
Contributions are welcome! Please see the Contributing Guide for details.