Immich with Docker: self-host your photos on Debian 13

Immich 3 on Debian 13, the open-source photo and video library with apps for your phone, face recognition and search by what is in the picture, in rootless Docker under a user of its own behind Caddy.

Tested on Docker steps follow the tested rootless Docker base guide on Debian 13 with Docker Engine 29.10.1, Compose 5.8.1 and rootlesskit 3.3.0; the app version and app-specific behaviour are from the tested Podman guide on a Melonslab server. Not re-tested end to end under Docker. Updated November 28, 2026

Recommended server for this guide

VC-S Micro · 2 vCPU · 8 GB Memory · 250 GB Storage

Month to month, no lock-in 7-day money-back guarantee

€7.99/mo

Deploy now

Quick install on a fresh VM

This command sets up a rootless container engine and a directory for this service. Podman is the default; add --engine docker to the command to use Docker instead.

curl -fsSL https://www.melonslab.com/install/rootless.sh | bash -s -- --app immich-docker --manifest immich --sha256 2ce4f182e6fa39aa4cb1721cbe77e2b66621c3d99a3f1225e2eb832a9361408d
View the script

SHA-256: 97785be3e3e91393181a4a7caeab5f4b52803bf52e960dd488945cb38c6473a2

Run this guide on Melonslab

We ran every step below on our own server. For this workload we recommend VC-S Micro at €7.99/mo. Order it, pick Debian 13, and follow the guide.

  1. 1. Order the server. Use the button below to order the recommended plan. Choose Debian 13 when the installer asks for an operating system.
  2. 2. Add IPv4 if needed. Add it on the order form when the guide publishes a service on the internet. It is a paid add-on, not included in the plan.
  3. 3. Connect over SSH. Log in as root with the address and credentials from your order, then run the commands below.
  4. 4. Follow the verified steps. Every command in this guide was run on a Melonslab server before it was published.
Deploy now
On this page

What you will set up

Immich backs up the photos and videos from your phone and shows them in a timeline, on a map and in albums you can share. It recognises faces, and it can search by what is in a picture: type a dog on a beach, and it finds it. The phone apps upload new pictures by themselves.

Here it runs as a Compose project under a user of its own called immich, behind Caddy from the Docker guide: the Immich server, its machine learning, PostgreSQL and Valkey. The photos stay on your server, in a folder you can back up.

The app-specific results below come from the tested Podman guide on a Melonslab server with Debian 13:

  • Immich 3.2.2 was set up, and two photos were uploaded through its API, the way the phone apps upload.
  • Thumbnails were made, and a search for a dog put the dog first, and a cat the cat.
  • Everything came back by itself after a reboot, with the search still working.

In the Podman test, the pod used about 2.2 GB of memory, over half of it for machine learning. Immich asks for at least 6 GB on the server, and recommends 8 GB. With 4 GB, it runs with machine learning turned off. The photos take the space they take, so check your server's disk before you move a large library.

The Docker version below follows the tested rootless Docker base guide. The app-specific results above come from the tested Podman guide on a Melonslab server; they were not measured under Docker.

Before you start

You need:

  • a server set up as in the Docker guide, with Caddy running, and at least 6 GB of memory;
  • an A record and an AAAA record for photos.example.com pointing at your server.

The examples use photos.example.com for Immich and 203.0.113.10 for your server's IPv4 address, which ip -brief address show eth0 shows. Replace them throughout.

1. Create the user

As root:

useradd -m -s /bin/bash immich
loginctl enable-linger immich
uid=$(id -u immich)

Everything up to step 4 runs as immich.

2. Create the database password

The passwords are generated with the Compose file in the next step and kept in a 0600 file under the app directory.

3. Define the Compose project

Create a Compose file in the app's directory. It uses the same images, ports, volumes, environment and restart policy as the Podman guide:

mkdir -p /home/immich/immich
cat > /home/immich/immich/compose.yaml <<'YAML'
services:
  db:
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0
    volumes:
      - db:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: postgres
      POSTGRES_DB: immich
      POSTGRES_INITDB_ARGS: --data-checksums
    env_file: immich.env
    restart: always
  redis:
    image: docker.io/valkey/valkey:9
    restart: always
  ml:
    image: ghcr.io/immich-app/immich-machine-learning:v3
    volumes:
      - model-cache:/cache
    restart: always
  server:
    image: ghcr.io/immich-app/immich-server:v3
    ports:
      - "127.0.0.1:8098:2283"
    shm_size: 128m
    volumes:
      - /home/immich/immich/library:/data
    environment:
      DB_HOSTNAME: 127.0.0.1
      DB_USERNAME: postgres
      DB_DATABASE_NAME: immich
      REDIS_HOSTNAME: 127.0.0.1
      IMMICH_MACHINE_LEARNING_URL: http://127.0.0.1:3003
      TZ: Europe/Stockholm
      IMMICH_TRUSTED_PROXIES: 203.0.113.10
    env_file: immich.env
    restart: always
volumes:
  db:
  model-cache:
YAML
umask 077
pw=$(openssl rand -hex 24)
printf 'POSTGRES_PASSWORD=%s\nDB_PASSWORD=%s\n' "$pw" "$pw" > /home/immich/immich/immich.env
unset pw
chmod 600 /home/immich/immich/immich.env
chown -R immich:immich /home/immich/immich
uid=$(id -u immich)
runuser -u immich -- env HOME=/home/immich XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash -lc "cd /home/immich/immich && docker compose up -d"

Use the weekly docker-update.service/docker-update.timer from the rootless Docker guide instead of Podman's auto-update timer. It runs docker compose pull and docker compose up -d in the app directory each Sunday. Set it up once for immich as shown there; it covers every Compose app in that user's home.

The first start downloads the images, which take about 3.6 GB of disk, and takes a few minutes.

4. Put Caddy in front

Go back to root with exit, switch to runuser -u caddy -- /bin/bash, and add this block at the end of ~/Caddyfile:

photos.example.com {
    reverse_proxy 127.0.0.1:8098
}

Restart Caddy with docker compose restart caddy from /home/caddy/caddy as caddy. Caddy passes uploads of any size, so large videos go through too.

5. Set it up

Open https://photos.example.com, and choose Getting Started. Create the admin account, with Admin Email, Admin Password, Confirm Admin Password and Name, and log in. Immich then walks you through a few settings. Two of them are about outside services:

  • Server Privacy: Map loads map tiles from tiles.immich.cloud, and Version Check asks version.immich.cloud for new releases. Both are on. Turn them off if you want Immich not to contact anyone.
  • User Privacy: Google Cast loads resources from Google. It is off, and this guide leaves it off.

Every setting can be changed later, under Administration and Settings.

To give someone else an account, open Administration, Users, and choose Create user. Immich has no open sign-up page.

6. Upload from your phone

Install Immich's app for Android or iPhone. Enter https://photos.example.com as the server, log in, and turn on backup for the albums you want. New photos then go to your server by themselves. On a computer, drag photos into the web page.

The first time Immich processes photos, its machine-learning container downloads its models, about 800 MB: from Hugging Face, and the model that reads text in pictures from ModelScope. Only the models are downloaded. Your photos never leave your server.

7. Back up

Everything worth keeping is in ~/immich/library: the photos and videos as they were uploaded, and, in its backups folder, a copy of the database that Immich makes every night at 02:00, keeping the last 14. Copy the whole folder to another machine regularly, for example with rsync.

To make a copy of the database right now, as immich:

uid=$(id -u immich)
runuser -u immich -- env HOME=/home/immich XDG_RUNTIME_DIR=/run/user/$uid \
  DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
  bash <<'SH'
cd /home/immich/immich
mkdir -p ~/backup
docker compose exec -T db pg_dumpall --clean --if-exists -U postgres | gzip > ~/backup/immich-db.sql.gz
SH

Troubleshooting

Search finds nothing, or faces are not recognised. Machine learning runs in the background, after thumbnails. Administration, Job Queues shows what is waiting. The first run also waits for the models to download.

The page does not load after an update. Read docker compose logs server. A new Immich release sometimes needs a new database image: its release notes say so, and name the new tag for compose.yaml.

Run it on your own server

VC-S Micro

€7.99/mo

vCPU
2
Memory
8 GB
Storage
250 GB
Transfer
10 TB
Standard
HDD · RAID 10
  • Full root access
  • Native /64 IPv6
  • RAID-protected storage
  • Malmö, Sweden
  • Month to month, no lock-in
  • 7-day money-back guarantee

Related comparisons and alternatives

All guides