Docs / Self-Hosted Applications / Setting Up Immich for Photo Management

Setting Up Immich for Photo Management

By Admin · Mar 22, 2026 · Updated Apr 23, 2026 · 6 views · 3 min read

Managing immich effectively is a crucial skill for any system administrator. This tutorial provides step-by-step instructions for photos configuration, along with best practices for production environments.

Prerequisites

  • A VPS running Ubuntu 22.04 or later (2GB+ RAM recommended)
  • Basic familiarity with the Linux command line
  • A registered domain name (for public-facing services)

Docker Compose Setup

When scaling this setup, consider vertical scaling (adding more RAM/CPU) first, as it's simpler to implement. Horizontal scaling adds complexity but may be necessary for high-traffic applications.


# docker-compose.yml
version: '3.8'
services:
  immich:
    image: immich/immich:latest
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - immich_data:/data
      - immich_config:/config
    environment:
      - TZ=UTC
      - PUID=1000
      - PGID=1000
    depends_on:
      - db

  db:
    image: postgres:16-alpine
    restart: unless-stopped
    volumes:
      - db_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=immich
      - POSTGRES_USER=immich
      - POSTGRES_PASSWORD=changeme

volumes:
  immich_data:
  immich_config:
  db_data:

Each line in the configuration serves a specific purpose. The comments explain the reasoning behind each setting, making it easier to customize for your specific use case.

Initial Configuration

For production deployments, consider implementing high availability by running multiple instances behind a load balancer. This approach provides both redundancy and improved performance under heavy load.


# Reverse proxy configuration
server {
    listen 443 ssl http2;
    server_name immich.example.com;

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

    location / {
        proxy_pass http://127.0.0.1:8080;
        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_buffering off;
        client_max_body_size 0;
    }
}

Each line in the configuration serves a specific purpose. The comments explain the reasoning behind each setting, making it easier to customize for your specific use case.

Reverse Proxy Integration

The photos component plays a crucial role in the overall architecture. Understanding how it interacts with immich will help you make better configuration decisions.


# docker-compose.yml
version: '3.8'
services:
  immich:
    image: immich/immich:latest
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - immich_data:/data
      - immich_config:/config
    environment:
      - TZ=UTC
      - PUID=1000
      - PGID=1000
    depends_on:
      - db

  db:
    image: postgres:16-alpine
    restart: unless-stopped
    volumes:
      - db_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=immich
      - POSTGRES_USER=immich
      - POSTGRES_PASSWORD=changeme

volumes:
  immich_data:
  immich_config:
  db_data:

This configuration provides a good balance between performance and resource usage. For high-traffic scenarios, you may need to increase the limits further.

Conclusion

This guide covered the essential steps for working with immich on a VPS environment. For more advanced configurations, refer to the official documentation. Don't hesitate to reach out to our support team if you need help with your specific setup.

Was this article helpful?