← All articles
Rows of dark cubes with glowing green lines.

Immich: Self-Hosted Google Photos Alternative

Media 2026-03-04 · 4 min read immich photo management self-hosted docker google photos alternative mobile backup face recognition open-source
By Selfhosted Guides Editorial TeamSelf-hosting practitioners covering open source software, home lab infrastructure, and data sovereignty.

Google Photos changed behavior in 2021 — ending unlimited free storage and enforcing quotas. For people with large photo libraries, the alternatives are paying Google or finding something else. Immich is the most capable self-hosted replacement: mobile backup apps, face recognition, album sharing, timeline view, and map view. It's a full-featured photo management system.

Photo by Steve Johnson on Unsplash

What Immich Provides

Docker Compose Deployment

Immich requires several services: the server, microservices worker (for ML tasks), Redis, PostgreSQL, and a machine learning container:

# docker-compose.yml
name: immich

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

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

  redis:
    image: redis:6.2-alpine
    restart: always

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

volumes:
  pgdata:
  model-cache:

Create a .env file:

# Immich configuration
UPLOAD_LOCATION=/path/to/your/photo/storage
DB_PASSWORD=change-this-password
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

# No quotes around values in .env

Start:

docker compose up -d

Navigate to http://your-server:2283 for initial setup.

Note: Immich uses tensorchord/pgvecto-rs (PostgreSQL with vector extension) instead of standard PostgreSQL. This is required — don't swap it for a regular Postgres image.

Initial Setup

  1. Open http://your-server:2283
  2. Create the admin account
  3. Configure server settings (Administration → Settings):
    • Storage template: customize how files are organized on disk
    • Machine learning model: choose face recognition model (faster vs more accurate)
    • SMTP for email notifications

Like what you're reading? Subscribe to Self-Hosted Weekly — free weekly guides in your inbox.

Mobile App Setup

Install the Immich app on iOS or Android.

  1. Open app → Enter your server URL: http://your-server:2283 (or https:// if you've set up a reverse proxy)
  2. Log in with your credentials
  3. Grant photo library permissions
  4. Configure backup: Settings → Backup → Auto backup when charging and on Wi-Fi

The mobile app backs up original quality files. Backup runs in the background and shows progress.

Tip: Set up a reverse proxy (Nginx Proxy Manager or Caddy) with HTTPS so the mobile app works over cellular when you're away from home. Use a real domain or subdomain pointing to your server.

Reverse Proxy Setup (Caddy example)

photos.yourdomain.com {
  reverse_proxy localhost:2283
  tls [email protected]
}

With HTTPS, the mobile app can back up photos when you're not on your home Wi-Fi.

Face Recognition

Immich performs face detection and clustering automatically as photos are processed. After faces are detected:

  1. Explore → People — see detected face clusters
  2. Assign names to faces
  3. Search by person name: "Photos of Alice"

The ML container handles this. It downloads the face recognition model on first use (~500MB). Processing is CPU-bound; a faster CPU processes faces faster.

Import Existing Photo Library

If you have existing photos (local drive, Google Photos export, iCloud export):

From local directory: Mount the directory as an external library:

From Google Photos takeout:

# Google Takeout exports a zip; extract it first
# Use immich-go tool for bulk import
go install github.com/simulot/immich-go@latest

immich-go -server http://your-server:2283 -key YOUR_API_KEY \
  upload --google-photos /path/to/takeout

The immich-go tool handles Google Takeout's metadata structure and imports photos with correct dates.

Storage Template

Customize how Immich organizes uploaded files on disk (Administration → Settings → Storage Template):

Default: {{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}

Results in: 2024/2024-06-15/IMG_5432.JPG

You can customize with any combination of date, time, and metadata variables.

Backup Immich

Back up two things:

  1. PostgreSQL database: Contains all metadata, albums, faces, users
  2. Upload location: The actual photo files
# Database backup
docker exec -t immich_database_1 pg_dumpall -c -U postgres > immich_backup_$(date +%Y%m%d).sql

# Photo storage: already on your disk, include in regular backup strategy
# rsync, restic, rclone, etc.

Hardware Requirements

Use case RAM CPU
Small library (<20K photos) 4GB 2 cores
Medium library (20-100K) 8GB 4 cores
Large library (100K+) 16GB+ 6+ cores

Machine learning (face recognition, CLIP search) is CPU-intensive. A NAS with a low-power processor will process ML tasks slowly but correctly — it's asynchronous, so it doesn't affect the user experience.

GPU acceleration for ML: Immich supports CUDA (NVIDIA) and OpenVINO (Intel) for accelerated inference. Optional but dramatically faster for large libraries.

Privacy Considerations

Photos stay on your server. No data is sent to third-party services:

This is the point of self-hosting: your family photos don't train someone else's models.

The repository is immich-app/immich. It's under active development with frequent releases. Check the GitHub releases page before updating — Immich occasionally has breaking database migrations that require following the upgrade process.

Get free weekly tips in your inbox. Subscribe to Self-Hosted Weekly