LibrePhotos is a self-hosted photo management platform designed for users who want full control over their photo libraries without relying on cloud services. It’s ideal for photographers, families, and privacy-conscious individuals who need to organize, search, and browse thousands of photos and videos with AI assistance. The system automatically scans your file system, extracts metadata, and applies machine learning to tag faces, detect scenes, and generate semantic search indexes.
Built with Django 5 and PostgreSQL for the backend, and React 18 with TypeScript for the frontend, LibrePhotos uses Docker for easy deployment. It integrates ImageMagick, FFmpeg, and ExifTool for media processing, and leverages face_recognition, scikit-learn, and places365 for AI-driven analysis. The platform supports multi-user environments and offers a full REST API with Swagger documentation.
What You Get
- AI Face Recognition - Automatically detects and clusters faces in photos using face_recognition and HDBSCAN, allowing you to name and search for people across your entire library.
- Semantic Image Search - Search photos using natural language like “beach at sunset” or “dog in grass” powered by image captioning and scene classification models.
- Reverse Geocoding - Automatically adds location tags to photos using geopy by converting GPS coordinates into human-readable addresses.
- Multiuser Support - Multiple users can have separate libraries with private albums and permissions, ideal for households or teams.
- Timeline View - Visual timeline of photos organized by date, with automatic event grouping like “Thursday in Berlin” based on location and time patterns.
- Raw Photo & Video Support - Handles RAW image formats (CR2, NEF, etc.) and video files with full metadata extraction and thumbnail generation via ImageMagick and FFmpeg.
Common Use Cases
- Managing a personal photo archive - A photographer uses LibrePhotos to organize 20,000+ photos and videos from 10 years of travel, using face recognition to find all photos of their child and semantic search to locate images of “mountain sunrise”.
- Running a family photo hub - A parent sets up LibrePhotos on a home server to let all family members upload and search photos, with private albums for each child and automatic face tagging for grandparents.
- Curating a professional photo library - A journalist uses LibrePhotos to tag and search through thousands of event photos, using reverse geocoding to map locations and object detection to find images containing specific objects like “traffic signs” or “crowds”.
- Privacy-focused media storage - A tech-savvy user replaces iCloud or Google Photos with LibrePhotos to avoid cloud data collection, while still enjoying AI-powered search and organization on their own hardware.
Under The Hood
Architecture
- Django-based MVC structure with clear separation of models, views, and serializers, ensuring clean layering and maintainability
- Business logic encapsulated in service layers via custom managers and utility modules, decoupling HTTP handling from domain operations
- Dependency injection leveraged through Django’s native resolution mechanisms, with test doubles enabling isolated unit testing
- Modular asset processing pipeline isolates external ML integrations, preserving core system simplicity and extensibility
- Comprehensive test suite organized by feature domain, reinforcing single-responsibility principles and edge case resilience
- Automated tooling enforces consistent code style and import ordering, reducing cognitive load and improving long-term maintainability
Tech Stack
- Python 3.11 backend powered by Django and Django REST Framework for robust API and authentication handling
- PostgreSQL with Django migrations and encrypted fields for secure, scalable data persistence
- Ruff with Django-aware rules and pre-commit hooks for automated code formatting and linting
- RenovateBot manages dependency updates with automated merging for minor and patch versions
- Headless image processing via PIL and embedded ML models for metadata extraction and clustering
- Docker-based deployment enables scalable, containerized microservice-style components
Code Quality
- Extensive test coverage spanning unit, integration, and end-to-end scenarios with well-structured test files organized by functionality
- Robust error handling with meaningful fallbacks, though custom exception classes could enhance precision
- Clear separation of concerns with consistent naming, descriptive test methods, and test data driven by fixtures and synthetic generation
- Strong type safety and data validation through Django model fields, computed properties, and structured metadata pipelines
- Comprehensive mocking patterns isolate external dependencies like face detection and file system operations
What Makes It Unique
- Native face recognition pipeline with custom training workflows, eliminating cloud dependencies and ensuring full data sovereignty
- Decentralized photo clustering using embedded feature vectors stored directly in the database for visual similarity grouping
- Smart album generation powered by temporal and spatial metadata analysis, creating context-aware collections automatically
- Fine-grained sharing permissions with real-time sync across devices without requiring a central server
- Built-in deduplication engine using perceptual hashing and EXIF analysis to preserve metadata while removing redundancies
- Self-hosted media processing with automatic format conversion and thumbnail generation, removing third-party service dependencies