PhotoPrism + MariaDB + TensorFlow
AI-powered photo management with face recognition.
Overview
PhotoPrism is an AI-powered photo management application that leverages TensorFlow for advanced image recognition, automatic tagging, and face detection. Originally developed as a privacy-focused alternative to Google Photos, PhotoPrism processes RAW files, organizes photos by location and date, and uses machine learning to classify images without sending data to external services. The application has gained popularity among photography enthusiasts and privacy-conscious users who want professional-grade photo management capabilities on their own infrastructure.
This stack combines PhotoPrism's AI capabilities with MariaDB's robust database performance and TensorFlow's machine learning processing power. MariaDB serves as the metadata repository, storing image classifications, face recognition data, album information, and user preferences, while TensorFlow handles the computationally intensive tasks of image analysis, object detection, and facial recognition. The integration allows PhotoPrism to maintain fast search capabilities across large photo libraries while performing real-time AI analysis of newly uploaded images.
Photographers, families with large digital photo collections, and organizations requiring private photo hosting will find this combination particularly valuable. The stack is ideal for users who need professional photo management features like RAW processing, GPS-based organization, and intelligent search, but want to maintain complete control over their data. Small creative agencies, photography studios, and tech-savvy households can deploy this to replace cloud photo services while gaining superior AI-powered organization capabilities.
Key Features
- TensorFlow-powered automatic image classification and object recognition with over 1000 labels
- Real-time face detection and clustering for organizing photos by people
- RAW file processing support for professional photography formats (CR2, NEF, ARW, DNG)
- GPS-based photo mapping with interactive world map visualization
- Color-based image search and filtering using advanced color analysis
- MariaDB optimized storage with InnoDB buffer pool configuration for fast metadata queries
- WebDAV synchronization for automatic photo backup from mobile devices
- Live photo support with video thumbnail generation and playback
Common Use Cases
- 1Photography studios managing client photo collections with AI-powered organization
- 2Families digitizing and organizing decades of photo archives with automatic face recognition
- 3Content creators building searchable stock photo libraries with automatic tagging
- 4Small businesses replacing Google Photos while maintaining AI search capabilities
- 5Privacy-focused individuals hosting personal photo collections without cloud dependencies
- 6Creative agencies organizing project assets with location and date-based categorization
- 7Hobbyist photographers processing and cataloging RAW files with professional tools
Prerequisites
- Minimum 4GB RAM (8GB recommended) for TensorFlow model processing and image analysis
- Docker and Docker Compose installed with at least 20GB available storage space
- Port 2342 available for PhotoPrism web interface access
- Basic understanding of photo file formats and metadata for optimal configuration
- CPU with adequate processing power for AI model inference (multi-core recommended)
- Environment variables configured: ADMIN_USER, ADMIN_PASSWORD, MYSQL_USER, MYSQL_PASSWORD, MYSQL_ROOT_PASSWORD
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 photoprism: 3 image: photoprism/photoprism:latest4 security_opt: 5 - seccomp:unconfined6 - apparmor:unconfined7 environment: 8 - PHOTOPRISM_ADMIN_USER=${ADMIN_USER}9 - PHOTOPRISM_ADMIN_PASSWORD=${ADMIN_PASSWORD}10 - PHOTOPRISM_AUTH_MODE=password11 - PHOTOPRISM_SITE_URL=http://localhost:2342/12 - PHOTOPRISM_ORIGINALS_LIMIT=500013 - PHOTOPRISM_HTTP_COMPRESSION=gzip14 - PHOTOPRISM_LOG_LEVEL=info15 - PHOTOPRISM_READONLY=false16 - PHOTOPRISM_EXPERIMENTAL=false17 - PHOTOPRISM_DISABLE_CHOWN=false18 - PHOTOPRISM_DISABLE_WEBDAV=false19 - PHOTOPRISM_DISABLE_SETTINGS=false20 - PHOTOPRISM_DISABLE_TENSORFLOW=false21 - PHOTOPRISM_DISABLE_FACES=false22 - PHOTOPRISM_DISABLE_CLASSIFICATION=false23 - PHOTOPRISM_DISABLE_RAW=false24 - PHOTOPRISM_RAW_PRESETS=false25 - PHOTOPRISM_JPEG_QUALITY=8526 - PHOTOPRISM_DETECT_NSFW=false27 - PHOTOPRISM_UPLOAD_NSFW=true28 - PHOTOPRISM_DATABASE_DRIVER=mysql29 - PHOTOPRISM_DATABASE_SERVER=mariadb:330630 - PHOTOPRISM_DATABASE_NAME=photoprism31 - PHOTOPRISM_DATABASE_USER=${MYSQL_USER}32 - PHOTOPRISM_DATABASE_PASSWORD=${MYSQL_PASSWORD}33 working_dir: /photoprism34 volumes: 35 - photoprism-originals:/photoprism/originals36 - photoprism-storage:/photoprism/storage37 ports: 38 - "2342:2342"39 depends_on: 40 - mariadb41 networks: 42 - photoprism-network43 restart: unless-stopped4445 mariadb: 46 image: mariadb:10.1147 security_opt: 48 - seccomp:unconfined49 - apparmor:unconfined50 command: --innodb-buffer-pool-size=512M --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=12051 environment: 52 - MARIADB_AUTO_UPGRADE=153 - MARIADB_INITDB_SKIP_TZINFO=154 - MARIADB_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}55 - MARIADB_DATABASE=photoprism56 - MARIADB_USER=${MYSQL_USER}57 - MARIADB_PASSWORD=${MYSQL_PASSWORD}58 volumes: 59 - mariadb-data:/var/lib/mysql60 networks: 61 - photoprism-network62 restart: unless-stopped6364volumes: 65 photoprism-originals: 66 photoprism-storage: 67 mariadb-data: 6869networks: 70 photoprism-network: 71 driver: bridge.env Template
.env
1# PhotoPrism2ADMIN_USER=admin3ADMIN_PASSWORD=secure_admin_password4MYSQL_ROOT_PASSWORD=secure_root_password5MYSQL_USER=photoprism6MYSQL_PASSWORD=secure_mysql_passwordUsage Notes
- 1Web UI at http://localhost:2342
- 2Login with admin credentials
- 3Upload photos via web or WebDAV
- 4AI indexing runs automatically
- 5Face recognition enabled
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
photoprism
photoprism:
image: photoprism/photoprism:latest
security_opt:
- seccomp:unconfined
- apparmor:unconfined
environment:
- PHOTOPRISM_ADMIN_USER=${ADMIN_USER}
- PHOTOPRISM_ADMIN_PASSWORD=${ADMIN_PASSWORD}
- PHOTOPRISM_AUTH_MODE=password
- PHOTOPRISM_SITE_URL=http://localhost:2342/
- PHOTOPRISM_ORIGINALS_LIMIT=5000
- PHOTOPRISM_HTTP_COMPRESSION=gzip
- PHOTOPRISM_LOG_LEVEL=info
- PHOTOPRISM_READONLY=false
- PHOTOPRISM_EXPERIMENTAL=false
- PHOTOPRISM_DISABLE_CHOWN=false
- PHOTOPRISM_DISABLE_WEBDAV=false
- PHOTOPRISM_DISABLE_SETTINGS=false
- PHOTOPRISM_DISABLE_TENSORFLOW=false
- PHOTOPRISM_DISABLE_FACES=false
- PHOTOPRISM_DISABLE_CLASSIFICATION=false
- PHOTOPRISM_DISABLE_RAW=false
- PHOTOPRISM_RAW_PRESETS=false
- PHOTOPRISM_JPEG_QUALITY=85
- PHOTOPRISM_DETECT_NSFW=false
- PHOTOPRISM_UPLOAD_NSFW=true
- PHOTOPRISM_DATABASE_DRIVER=mysql
- PHOTOPRISM_DATABASE_SERVER=mariadb:3306
- PHOTOPRISM_DATABASE_NAME=photoprism
- PHOTOPRISM_DATABASE_USER=${MYSQL_USER}
- PHOTOPRISM_DATABASE_PASSWORD=${MYSQL_PASSWORD}
working_dir: /photoprism
volumes:
- photoprism-originals:/photoprism/originals
- photoprism-storage:/photoprism/storage
ports:
- "2342:2342"
depends_on:
- mariadb
networks:
- photoprism-network
restart: unless-stopped
mariadb
mariadb:
image: mariadb:10.11
security_opt:
- seccomp:unconfined
- apparmor:unconfined
command: "--innodb-buffer-pool-size=512M --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=120"
environment:
- MARIADB_AUTO_UPGRADE=1
- MARIADB_INITDB_SKIP_TZINFO=1
- MARIADB_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MARIADB_DATABASE=photoprism
- MARIADB_USER=${MYSQL_USER}
- MARIADB_PASSWORD=${MYSQL_PASSWORD}
volumes:
- mariadb-data:/var/lib/mysql
networks:
- photoprism-network
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 photoprism:5 image: photoprism/photoprism:latest6 security_opt:7 - seccomp:unconfined8 - apparmor:unconfined9 environment:10 - PHOTOPRISM_ADMIN_USER=${ADMIN_USER}11 - PHOTOPRISM_ADMIN_PASSWORD=${ADMIN_PASSWORD}12 - PHOTOPRISM_AUTH_MODE=password13 - PHOTOPRISM_SITE_URL=http://localhost:2342/14 - PHOTOPRISM_ORIGINALS_LIMIT=500015 - PHOTOPRISM_HTTP_COMPRESSION=gzip16 - PHOTOPRISM_LOG_LEVEL=info17 - PHOTOPRISM_READONLY=false18 - PHOTOPRISM_EXPERIMENTAL=false19 - PHOTOPRISM_DISABLE_CHOWN=false20 - PHOTOPRISM_DISABLE_WEBDAV=false21 - PHOTOPRISM_DISABLE_SETTINGS=false22 - PHOTOPRISM_DISABLE_TENSORFLOW=false23 - PHOTOPRISM_DISABLE_FACES=false24 - PHOTOPRISM_DISABLE_CLASSIFICATION=false25 - PHOTOPRISM_DISABLE_RAW=false26 - PHOTOPRISM_RAW_PRESETS=false27 - PHOTOPRISM_JPEG_QUALITY=8528 - PHOTOPRISM_DETECT_NSFW=false29 - PHOTOPRISM_UPLOAD_NSFW=true30 - PHOTOPRISM_DATABASE_DRIVER=mysql31 - PHOTOPRISM_DATABASE_SERVER=mariadb:330632 - PHOTOPRISM_DATABASE_NAME=photoprism33 - PHOTOPRISM_DATABASE_USER=${MYSQL_USER}34 - PHOTOPRISM_DATABASE_PASSWORD=${MYSQL_PASSWORD}35 working_dir: /photoprism36 volumes:37 - photoprism-originals:/photoprism/originals38 - photoprism-storage:/photoprism/storage39 ports:40 - "2342:2342"41 depends_on:42 - mariadb43 networks:44 - photoprism-network45 restart: unless-stopped4647 mariadb:48 image: mariadb:10.1149 security_opt:50 - seccomp:unconfined51 - apparmor:unconfined52 command: --innodb-buffer-pool-size=512M --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=12053 environment:54 - MARIADB_AUTO_UPGRADE=155 - MARIADB_INITDB_SKIP_TZINFO=156 - MARIADB_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}57 - MARIADB_DATABASE=photoprism58 - MARIADB_USER=${MYSQL_USER}59 - MARIADB_PASSWORD=${MYSQL_PASSWORD}60 volumes:61 - mariadb-data:/var/lib/mysql62 networks:63 - photoprism-network64 restart: unless-stopped6566volumes:67 photoprism-originals:68 photoprism-storage:69 mariadb-data:7071networks:72 photoprism-network:73 driver: bridge74EOF7576# 2. Create the .env file77cat > .env << 'EOF'78# PhotoPrism79ADMIN_USER=admin80ADMIN_PASSWORD=secure_admin_password81MYSQL_ROOT_PASSWORD=secure_root_password82MYSQL_USER=photoprism83MYSQL_PASSWORD=secure_mysql_password84EOF8586# 3. Start the services87docker compose up -d8889# 4. View logs90docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/photoprism-complete/run | bashTroubleshooting
- PhotoPrism shows 'TensorFlow not available' error: Ensure PHOTOPRISM_DISABLE_TENSORFLOW=false and container has sufficient memory allocated
- Face recognition not working after photo upload: Check that PHOTOPRISM_DISABLE_FACES=false and run manual indexing from Settings > Library
- MariaDB connection refused during startup: Wait for MariaDB container to fully initialize (can take 30-60 seconds on first run) before PhotoPrism connects
- High CPU usage during photo indexing: Normal behavior when TensorFlow processes new images, reduce concurrent workers in advanced settings if needed
- RAW files not displaying thumbnails: Verify PHOTOPRISM_DISABLE_RAW=false and ensure sufficient storage space for thumbnail generation
- Database connection errors after restart: Check that mariadb-data volume persists and MARIADB_AUTO_UPGRADE=1 is set for schema updates
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
photoprismmariadbtensorflow
Tags
#photoprism#photos#ai#face-recognition#gallery
Category
Media & EntertainmentAd Space
Shortcuts: C CopyF FavoriteD Download