Immich Self-Hosted Photos
Immich Google Photos alternative with ML.
Overview
Immich is a modern, self-hosted photo and video backup solution that provides a Google Photos-like experience while maintaining complete control over your personal media. Developed as a privacy-focused alternative to cloud photo services, Immich combines automatic mobile backup with advanced machine learning capabilities for face recognition, object detection, and intelligent search. Unlike commercial solutions that impose storage limits and privacy concerns, Immich gives users unlimited storage capacity on their own hardware with sophisticated features like timeline views, album sharing, and geotagged photo mapping.
This deployment creates a complete Immich infrastructure using four specialized containers: immich-server handles the web interface and API operations, immich-machine-learning provides AI-powered face recognition and object detection, immich-db runs a PostgreSQL database with vector search extensions (pgvecto-rs) for storing metadata and enabling semantic search, and immich-redis manages caching and background job queues. The machine learning container operates independently to process photos for tagging and facial recognition without impacting the main server performance.
This stack is ideal for families wanting to replace Google Photos, photographers managing large collections, or privacy-conscious users seeking complete control over their media. The combination of automatic mobile backup, advanced search capabilities, and multi-user support makes it particularly valuable for households or small teams who want professional-grade photo management without recurring subscription costs or data privacy compromises.
Key Features
- Automatic mobile backup from iOS and Android apps with background synchronization
- Machine learning-powered face recognition and object detection for intelligent photo organization
- Vector-based semantic search using pgvecto-rs PostgreSQL extension for finding photos by content
- Interactive timeline with memories feature showing photos from previous years
- Geotagged photo mapping with location-based browsing and search
- Multi-user support with individual libraries and shared album capabilities
- Live photos support preserving motion from iPhone and compatible Android devices
- Bulk metadata extraction and duplicate detection for existing photo libraries
Common Use Cases
- 1Family photo backup replacing Google Photos with unlimited storage and privacy control
- 2Professional photographer portfolio management with client access and album sharing
- 3Small business asset management for storing product photos and marketing materials
- 4Travel documentation with automatic geotagging and location-based photo organization
- 5Homelab media server integration for comprehensive personal data sovereignty
- 6Multi-generational family archive with face recognition connecting photos across decades
- 7Photography enthusiast collection management with advanced search and tagging capabilities
Prerequisites
- Minimum 4GB RAM recommended for machine learning processing and PostgreSQL operations
- Port 2283 available for Immich web interface access
- Sufficient storage space for photo uploads in the configured upload directory
- Mobile device compatibility for iOS 12+ or Android 8+ for automatic backup features
- Understanding of photo library organization for optimal initial setup and user management
- Network access planning for mobile app connectivity and potential external access configuration
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 immich-server: 3 image: ghcr.io/immich-app/immich-server:release4 container_name: immich-server5 restart: unless-stopped6 ports: 7 - "${IMMICH_PORT:-2283}:2283"8 environment: 9 - DB_HOSTNAME=immich-db10 - DB_USERNAME=${DB_USER}11 - DB_PASSWORD=${DB_PASSWORD}12 - DB_DATABASE_NAME=immich13 - REDIS_HOSTNAME=immich-redis14 volumes: 15 - ${UPLOAD_PATH:-./uploads}:/usr/src/app/upload16 depends_on: 17 - immich-db18 - immich-redis1920 immich-machine-learning: 21 image: ghcr.io/immich-app/immich-machine-learning:release22 container_name: immich-ml23 restart: unless-stopped24 volumes: 25 - model_cache:/cache2627 immich-db: 28 image: tensorchord/pgvecto-rs:pg15-v0.2.029 container_name: immich-db30 restart: unless-stopped31 environment: 32 - POSTGRES_USER=${DB_USER}33 - POSTGRES_PASSWORD=${DB_PASSWORD}34 - POSTGRES_DB=immich35 volumes: 36 - immich_db_data:/var/lib/postgresql/data3738 immich-redis: 39 image: redis:7-alpine40 container_name: immich-redis41 restart: unless-stopped4243volumes: 44 immich_db_data: 45 model_cache: .env Template
.env
1# Immich Photos2IMMICH_PORT=22833UPLOAD_PATH=./uploads4DB_USER=immich5DB_PASSWORD=immich_passwordUsage Notes
- 1Immich at http://localhost:2283
- 2Download mobile apps for backup
- 3ML container for face recognition
- 4Uses pgvecto-rs for vector search
Individual Services(4 services)
Copy individual services to mix and match with your existing compose files.
immich-server
immich-server:
image: ghcr.io/immich-app/immich-server:release
container_name: immich-server
restart: unless-stopped
ports:
- ${IMMICH_PORT:-2283}:2283
environment:
- DB_HOSTNAME=immich-db
- DB_USERNAME=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_DATABASE_NAME=immich
- REDIS_HOSTNAME=immich-redis
volumes:
- ${UPLOAD_PATH:-./uploads}:/usr/src/app/upload
depends_on:
- immich-db
- immich-redis
immich-machine-learning
immich-machine-learning:
image: ghcr.io/immich-app/immich-machine-learning:release
container_name: immich-ml
restart: unless-stopped
volumes:
- model_cache:/cache
immich-db
immich-db:
image: tensorchord/pgvecto-rs:pg15-v0.2.0
container_name: immich-db
restart: unless-stopped
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=immich
volumes:
- immich_db_data:/var/lib/postgresql/data
immich-redis
immich-redis:
image: redis:7-alpine
container_name: immich-redis
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 immich-server:5 image: ghcr.io/immich-app/immich-server:release6 container_name: immich-server7 restart: unless-stopped8 ports:9 - "${IMMICH_PORT:-2283}:2283"10 environment:11 - DB_HOSTNAME=immich-db12 - DB_USERNAME=${DB_USER}13 - DB_PASSWORD=${DB_PASSWORD}14 - DB_DATABASE_NAME=immich15 - REDIS_HOSTNAME=immich-redis16 volumes:17 - ${UPLOAD_PATH:-./uploads}:/usr/src/app/upload18 depends_on:19 - immich-db20 - immich-redis2122 immich-machine-learning:23 image: ghcr.io/immich-app/immich-machine-learning:release24 container_name: immich-ml25 restart: unless-stopped26 volumes:27 - model_cache:/cache2829 immich-db:30 image: tensorchord/pgvecto-rs:pg15-v0.2.031 container_name: immich-db32 restart: unless-stopped33 environment:34 - POSTGRES_USER=${DB_USER}35 - POSTGRES_PASSWORD=${DB_PASSWORD}36 - POSTGRES_DB=immich37 volumes:38 - immich_db_data:/var/lib/postgresql/data3940 immich-redis:41 image: redis:7-alpine42 container_name: immich-redis43 restart: unless-stopped4445volumes:46 immich_db_data:47 model_cache:48EOF4950# 2. Create the .env file51cat > .env << 'EOF'52# Immich Photos53IMMICH_PORT=228354UPLOAD_PATH=./uploads55DB_USER=immich56DB_PASSWORD=immich_password57EOF5859# 3. Start the services60docker compose up -d6162# 4. View logs63docker 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/immich-photos-stack/run | bashTroubleshooting
- Mobile app cannot connect to server: Verify port 2283 is accessible and check firewall settings, ensure UPLOAD_PATH directory has proper write permissions
- Machine learning face recognition not working: Check that immich-machine-learning container has sufficient memory allocation and model_cache volume is properly mounted
- Database connection errors in immich-server: Verify DB_USER and DB_PASSWORD environment variables match between immich-server and immich-db services
- Slow photo upload and processing: Monitor Redis performance and consider increasing memory allocation for immich-redis container caching
- Search functionality not finding photos: Ensure pgvecto-rs extension is properly loaded in PostgreSQL and vector indexing has completed for uploaded photos
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
immichpostgresqlredismachine-learning
Tags
#photos#immich#backup#mobile
Category
Media & EntertainmentAd Space
Shortcuts: C CopyF FavoriteD Download