Skip to content

immich

High performance self-hosted photo and video management solution

Install immich

  1. Follow the immich installation guide.
  2. Install immich using either the Docker or script method.
  3. Start the immich service.
  4. Access immich on port 2283.
  1. Follow the immich installation guide to set up the self-hosted immich requirements, including the .env file.
  2. Create ls-net network with following command:

docker network inspect ls-net >/dev/null 2>&1 || docker network create ls-net
3. Add the following ls-net external network to the immich project’s docker-compose.yml file:

```yaml
name: immich

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

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
    disable: false

  redis:
    container_name: immich_redis
    image: docker.io/valkey/valkey:9@sha256:70739f85ad2ee01a726a965584a0f94895f01b0c60b3cc8b0aeef11eaa6888cf
    healthcheck:
    test: redis-cli ping | grep -q PONG || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23
    environment:
    POSTGRES_PASSWORD: ${DB_PASSWORD}
    POSTGRES_USER: ${DB_USERNAME}
    POSTGRES_DB: ${DB_DATABASE_NAME}
    POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    shm_size: 128mb
    restart: always
    healthcheck:
    disable: false

volumes:
  model-cache:

networks:
  ls-net:
    external: true
```

Set up OpenLiteSpeed proxy with AutoSSL

The easiest way to install OpenLiteSpeed, configure it as a reverse proxy, and enable AutoSSL is to use the ols1clk script.

Before continuing, ensure that your domain points to the server.

Replace www.example.com with your domain name, and run the following command:

bash <(curl -fsSL https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh) --proxy-c --proxy-port 2283 --proxy-s --autocert --sitedomain www.example.com

This command automatically:

  1. Download the ols-proxy-docker-env repository:

    git clone https://github.com/litespeedtech/ols-proxy-docker-env
    cd ols-proxy-docker-env
    
  2. Copy the example environment file:

    cp .env.example .env
    
  3. Edit .env with your configuration values:

    OLS_IMAGE=litespeedtech/openlitespeed:latest
    BACKEND_IP=immich_server
    BACKEND_PORT=2283
    DOMAIN=www.example.com
    PROXY_METHOD=context
    PROXY_SOCKET=true
    ACME_EMAIL=admin@example.com
    
  4. Start the proxy:

    docker compose up -d
    

Verify the proxy configuration

Open https://www.example.com in a browser. The application interface should load through OpenLiteSpeed over HTTPS.

Warning

After verifying the configuration, restrict public access to port 2283 using your firewall. Alternatively, you can configure the service to listen on 127.0.0.1 only, so port 2283 is not publicly accessible.

Optional settings

You can further enhance your site's security by enabling additional security features in the .env file, such as:

These other security features can be configured through the WebAdmin Console:

See the OpenLiteSpeed Security Guide for more information.

Warning

Some security features may interfere with application services or block legitimate requests. Test these settings thoroughly before applying them in a production environment.