docker.recipes

Immich

intermediate

High-performance photo and video backup solution.

Overview

Immich is a self-hosted photo and video management solution that provides a Google Photos-like experience with complete control over your data. Developed as a modern alternative to cloud photo services, Immich offers automatic mobile backup, AI-powered search capabilities, face recognition, and intuitive organization features without the privacy concerns or storage limitations of commercial platforms. This Docker stack combines Immich's main server with PostgreSQL using the pgvecto-rs extension for vector similarity searches, Redis for caching and session management, and a dedicated machine learning container that handles AI features like face recognition, object detection, and CLIP-based semantic search. The specialized PostgreSQL variant includes vector database capabilities essential for Immich's AI-powered search functionality, while Redis ensures fast response times for the web interface and mobile apps. This configuration is ideal for families, photography enthusiasts, and privacy-conscious users who want professional-grade photo management without relying on third-party cloud services, offering unlimited storage capacity limited only by your hardware while maintaining complete data ownership.

Key Features

  • Automatic mobile photo and video backup with iOS and Android apps
  • AI-powered face recognition and clustering for easy person-based searching
  • CLIP-based semantic search allowing natural language queries like 'beach sunset'
  • Object and scene detection for automatic photo categorization and tagging
  • Interactive world map view showing geotagged photos with location clustering
  • Memories feature that creates automatic yearly recaps and highlights
  • Live Photos support preserving motion from iPhone captures
  • Multi-user support with individual libraries and shared album capabilities

Common Use Cases

  • 1Family photo backup replacing Google Photos with unlimited storage capacity
  • 2Photography enthusiast's personal archive with AI-powered organization and search
  • 3Small business photo management for product catalogs or event documentation
  • 4Travel photography collection with automatic location mapping and memories
  • 5Multi-generational family sharing with secure album distribution to relatives
  • 6Content creator's media library with semantic search for quick asset retrieval
  • 7Privacy-focused individuals wanting complete control over personal photo data

Prerequisites

  • Minimum 4GB RAM recommended for smooth AI processing and face recognition
  • At least 50GB free disk space for initial setup plus storage for your photo collection
  • Port 2283 available for web interface access and mobile app connectivity
  • Mobile device with iOS or Android for automatic photo backup functionality
  • Basic understanding of environment variables for database password configuration
  • Network storage or external drive mounted if managing large photo collections

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:release
4 container_name: immich-server
5 restart: unless-stopped
6 environment:
7 DB_HOSTNAME: postgres
8 DB_USERNAME: immich
9 DB_PASSWORD: ${DB_PASSWORD}
10 DB_DATABASE_NAME: immich
11 REDIS_HOSTNAME: redis
12 volumes:
13 - ${UPLOAD_LOCATION}:/usr/src/app/upload
14 ports:
15 - "2283:2283"
16 depends_on:
17 - redis
18 - postgres
19 networks:
20 - immich
21
22 immich-machine-learning:
23 image: ghcr.io/immich-app/immich-machine-learning:release
24 container_name: immich-ml
25 restart: unless-stopped
26 volumes:
27 - immich_ml:/cache
28 networks:
29 - immich
30
31 postgres:
32 image: tensorchord/pgvecto-rs:pg14-v0.2.0
33 container_name: immich-postgres
34 restart: unless-stopped
35 environment:
36 POSTGRES_USER: immich
37 POSTGRES_PASSWORD: ${DB_PASSWORD}
38 POSTGRES_DB: immich
39 volumes:
40 - immich_postgres:/var/lib/postgresql/data
41 networks:
42 - immich
43
44 redis:
45 image: redis:alpine
46 container_name: immich-redis
47 restart: unless-stopped
48 networks:
49 - immich
50
51volumes:
52 immich_ml:
53 immich_postgres:
54
55networks:
56 immich:
57 driver: bridge

.env Template

.env
1DB_PASSWORD=changeme
2UPLOAD_LOCATION=./uploads

Usage Notes

  1. 1Docs: https://immich.app/docs/overview/introduction
  2. 2Access at http://localhost:2283 - create admin account on first visit
  3. 3Mobile apps: iOS and Android for automatic photo backup
  4. 4ML container handles face recognition, object detection, CLIP search
  5. 5Set UPLOAD_LOCATION to your photos directory path
  6. 6Google Photos alternative with excellent search and organization

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
  environment:
    DB_HOSTNAME: postgres
    DB_USERNAME: immich
    DB_PASSWORD: ${DB_PASSWORD}
    DB_DATABASE_NAME: immich
    REDIS_HOSTNAME: redis
  volumes:
    - ${UPLOAD_LOCATION}:/usr/src/app/upload
  ports:
    - "2283:2283"
  depends_on:
    - redis
    - postgres
  networks:
    - immich
immich-machine-learning
immich-machine-learning:
  image: ghcr.io/immich-app/immich-machine-learning:release
  container_name: immich-ml
  restart: unless-stopped
  volumes:
    - immich_ml:/cache
  networks:
    - immich
postgres
postgres:
  image: tensorchord/pgvecto-rs:pg14-v0.2.0
  container_name: immich-postgres
  restart: unless-stopped
  environment:
    POSTGRES_USER: immich
    POSTGRES_PASSWORD: ${DB_PASSWORD}
    POSTGRES_DB: immich
  volumes:
    - immich_postgres:/var/lib/postgresql/data
  networks:
    - immich
redis
redis:
  image: redis:alpine
  container_name: immich-redis
  restart: unless-stopped
  networks:
    - immich

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 immich-server:
5 image: ghcr.io/immich-app/immich-server:release
6 container_name: immich-server
7 restart: unless-stopped
8 environment:
9 DB_HOSTNAME: postgres
10 DB_USERNAME: immich
11 DB_PASSWORD: ${DB_PASSWORD}
12 DB_DATABASE_NAME: immich
13 REDIS_HOSTNAME: redis
14 volumes:
15 - ${UPLOAD_LOCATION}:/usr/src/app/upload
16 ports:
17 - "2283:2283"
18 depends_on:
19 - redis
20 - postgres
21 networks:
22 - immich
23
24 immich-machine-learning:
25 image: ghcr.io/immich-app/immich-machine-learning:release
26 container_name: immich-ml
27 restart: unless-stopped
28 volumes:
29 - immich_ml:/cache
30 networks:
31 - immich
32
33 postgres:
34 image: tensorchord/pgvecto-rs:pg14-v0.2.0
35 container_name: immich-postgres
36 restart: unless-stopped
37 environment:
38 POSTGRES_USER: immich
39 POSTGRES_PASSWORD: ${DB_PASSWORD}
40 POSTGRES_DB: immich
41 volumes:
42 - immich_postgres:/var/lib/postgresql/data
43 networks:
44 - immich
45
46 redis:
47 image: redis:alpine
48 container_name: immich-redis
49 restart: unless-stopped
50 networks:
51 - immich
52
53volumes:
54 immich_ml:
55 immich_postgres:
56
57networks:
58 immich:
59 driver: bridge
60EOF
61
62# 2. Create the .env file
63cat > .env << 'EOF'
64DB_PASSWORD=changeme
65UPLOAD_LOCATION=./uploads
66EOF
67
68# 3. Start the services
69docker compose up -d
70
71# 4. View logs
72docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/immich-v3/run | bash

Troubleshooting

  • Machine learning container consuming excessive memory: Reduce concurrent face recognition jobs in admin settings or allocate more RAM to the Docker host
  • Mobile app fails to backup photos: Check that port 2283 is accessible from your network and verify the server URL in mobile app settings
  • Face recognition not working on uploaded photos: Ensure the machine learning container is running and check job queue status in admin panel
  • PostgreSQL connection errors on startup: Verify DB_PASSWORD environment variable matches between immich-server and postgres containers
  • Slow photo loading and thumbnails: Increase Redis memory allocation or check if upload volume has sufficient disk space and proper permissions
  • Upload location permission denied: Ensure the UPLOAD_LOCATION directory has proper read/write permissions for the container user

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

Ad Space