Skip to main content
Back to Category

Immich Setup: Self-Hosted Photo and Video Backup

Immich Docker installation, automatic photo and video backup, face recognition, map view, shared albums, mobile app and self-hosted Google Photos alternative.

Read time: 14 dk Self-Hosting
immichphotovideobackupself-hostingdockergoogle photos alternative
Author
REXE Teknoloji Network & Security Team
Editor
REXE Teknoloji Technical Editorial
First published
Last updated

Immich Setup: Self-Hosted Photo and Video Backup

Immich is a self-hosted photo and video backup platform developed as an open-source alternative to Google Photos. It offers modern features like automatic backup via mobile apps, face recognition, map view, and shared albums.

What is Immich?

Immich lets you host your photo and video collection on your own server:

  • Automatic backup: Background backup via iOS and Android apps
  • Face recognition: Automatic face detection and grouping with machine learning
  • Map view: View photos on a map using GPS data
  • Shared albums: Share albums with family and friends
  • Timeline: Chronological photo browser
  • Search: Smart search by object, scene, and text

System Requirements

  • Docker and Docker Compose
  • Minimum 4 GB RAM (8 GB recommended for ML models)
  • Sufficient disk space (depends on photo/video collection)
  • PostgreSQL 14+ (auto-installed via Docker Compose)

Docker Installation

docker-compose.yml

hljs yaml
version: '3.8'

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:release
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - "2283:2283"
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:release
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine
    restart: always
    healthcheck:
      test: redis-cli ping || exit 1

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.2.0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  pgdata:
  model-cache:

.env File

hljs bash
UPLOAD_LOCATION=/data/immich/upload
DB_PASSWORD=StrongPass123!
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Starting the Installation

hljs bash
mkdir -p /data/immich/upload
docker compose up -d
docker logs immich_server -f

Access the Immich web interface at http://SERVER_IP:2283. You'll need to create an admin account on first login.

Nginx Reverse Proxy

hljs nginx
server {
    listen 443 ssl http2;
    server_name photos.example.com;

    ssl_certificate /etc/letsencrypt/live/photos.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/photos.example.com/privkey.pem;

    client_max_body_size 50000M;

    location / {
        proxy_pass http://127.0.0.1:2283;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 600s;
        proxy_send_timeout 600s;
    }
}

Mobile App Setup

  1. Download "Immich" from App Store or Google Play
  2. Enter server URL: https://photos.example.com
  3. Log in with username and password
  4. Configure automatic backup settings:
    • Background backup: Enabled
    • Backup on Wi-Fi: Enabled
    • Backup on mobile data: Optional
    • Video backup: Enabled/Disabled

External Library

hljs yaml
services:
  immich-server:
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /mnt/photos:/mnt/photos:ro
Administration → External Libraries
- Import Path: /mnt/photos
- Scan frequency: Every 24 hours
- Exclusion patterns: *.tmp, Thumbs.db

Machine Learning Settings

Administration → Machine Learning
- Face recognition: Enabled
- Smart search (CLIP): Enabled
- Object detection: Enabled
- Minimum face confidence score: 0.7

Backup

hljs bash
# Database backup
docker exec immich_postgres pg_dumpall -U postgres | \
  gzip > /backups/immich-db-$(date +%Y%m%d).sql.gz

# Upload directory backup
rsync -avz /data/immich/upload/ /backups/immich-upload/

Update

hljs bash
docker exec immich_postgres pg_dumpall -U postgres > immich-backup.sql
docker compose pull
docker compose up -d
docker logs immich_server -f

Immich is still under active development. Major version updates may contain breaking changes. Always back up the database before updating and read the release notes.

Conclusion

Immich is a powerful self-hosted alternative to Google Photos. You can securely store your photos and videos on your own server and benefit from modern features like face recognition and smart search. With 8 GB RAM on REXE servers, you can manage thousands of photos seamlessly.

Frequently Asked Questions

How much disk space does Immich require?

Disk space depends entirely on your photo/video collection size. Immich stores original files and creates additional thumbnails (~10-15% extra space). For 10,000 photos, expect about 50-100 GB; much more if you have video collections. ML model cache requires an additional ~2 GB.

The mobile app can't connect to the server.

Check: 1) Verify the server URL is correct (including https://), 2) Check that port 2283 is open in the firewall, 3) If using Nginx reverse proxy, verify WebSocket support is enabled, 4) Check that the SSL certificate is valid (self-signed certificates may cause issues on mobile).

Face recognition isn't working or is very slow.

Check that the ML container is running (docker ps). Initial scanning can take hours for large collections. Minimum 4 GB RAM required (8 GB recommended). Verify face recognition is enabled in Administration → Machine Learning. Check errors with docker logs immich_machine_learning.

How do I import my existing photo collection?

Two methods: 1) External library — mount your photo directory as a read-only volume and scan from Administration → External Libraries. 2) CLI tool — bulk upload with immich-cli: npx immich upload --recursive /path/to/photos. External library reads files in place without copying.

Immich stopped working after an update.

If you have a database backup, you can restore it. Stop all containers with docker compose down. Pull images again with docker compose pull. Start with docker compose up -d. Check logs: docker logs immich_server. If the issue persists, search GitHub Issues or roll back to the previous version.

What are the differences between Immich and Google Photos?

Immich advantages: Your data stays with you, no storage limits (as much as your disk), free and open source. Disadvantages: You need to manage your own server, not as advanced as Google's AI features (but improving rapidly), hasn't reached stable 1.0 yet. Core features (backup, face recognition, search, sharing) are available.

Related Articles

Network TrafficInbound GbpsOutbound Gbps