immich-layer
Recipe card from the charly-immich plugin (Images — the deployable catalog).
immich – Self-hosted photo management server (server + web + ML in one candy)
Section titled “immich – Self-hosted photo management server (server + web + ML in one candy)”Candy Properties
Section titled “Candy Properties”| Property | Value |
|---|---|
| Dependencies | supervisord, nodejs, postgresql, redis, ffmpeg |
| Ports | 2283 (server + web UI), 3003 (machine learning) |
| Volumes | library -> ~/.immich/library, import -> ~/.immich/import, external -> ~/.immich/external, models -> ~/.immich/models |
| Service | immich-db-init (oneshot, priority 15), immich-server (priority 30), immich-ml (priority 40) |
| Route | immich.localhost:2283 |
Environment Variables
Section titled “Environment Variables”| Variable | Value |
|---|---|
IMMICH_VERSION (var) |
v3.4.2 |
IMMICH_SOURCE_REF |
v3.4.2 (what start.sh-style wrappers log) |
IMMICH_HOST / IMMICH_PORT |
0.0.0.0 / 2283 |
IMMICH_MEDIA_LOCATION |
~/.immich/library |
IMMICH_MACHINE_LEARNING_ENABLED |
true |
IMMICH_MACHINE_LEARNING_URL |
http://127.0.0.1:3003 |
MACHINE_LEARNING_HOST / _PORT / _WORKERS / _WORKER_TIMEOUT |
0.0.0.0 / 3003 / 1 / 120 |
HF_HOME |
~/.immich/models — the model cache folder. The ML venv ships huggingface_hub, which honours HF_HOME; the older TRANSFORMERS_CACHE name is read by nothing in v3.4.2 (measured in this image: 9 HF_HOME references in the venv, 0 for TRANSFORMERS_CACHE), and must not be set |
DB_HOSTNAME / DB_DATABASE_NAME |
~/.postgresql (socket dir) / immich |
DB_USERNAME / DB_PASSWORD |
immich / immich |
REDIS_HOSTNAME / REDIS_PORT |
127.0.0.1 / 6379 |
NODE_ENV |
production |
IMMICH_MACHINE_LEARNING_URL is not optional in this image: Immich’s own default
(http://immich-machine-learning:3003) names the upstream docker-compose service and
does not resolve here, where the ML backend is a supervised service in the SAME image.
Packages
Section titled “Packages”The candy is multi-distro — image libraries are declared per distro:
- RPM:
vips,vips-devel,perl-Image-ExifTool,libheif,LibRaw,gcc-c++,make,unzip,curl,python3 - PAC:
libvips(no separate-develsplit — headers ship in the same package),libheif,libraw,perl-image-exiftool,gcc(includesg++),make,unzip,curl,python
Note: FFmpeg is provided via the ffmpeg dependency candy rather than installed directly.
Build Process (v3.4.2 from-source recipe)
Section titled “Build Process (v3.4.2 from-source recipe)”Every version below is what Immich v3.4.2 itself pins (root package.json
packageManager, .nvmrc, mise.toml): pnpm 12.15.0, extism-js v1.7.0
(js-pdk), binaryen version_124, uv 0.8.15, and the ML venv’s Python 3.13.
-
Toolchain — pnpm 12.15.0 (a tarball in the 12.x line, not the 10.x single binary) into
/opt/immich/pnpm; uv from its release tarball. The image’s own pnpm fromlayer-nodejsis deliberately NOT replaced. The pin is the candy’sIMMICH_PNPM_VERSIONvar, NAMESPACED becausevar:values are exported as image ENV: an un-namespaced pnpm pin here is global and shadowslayer-nodejs’s own same-named pin, whose measurement check reads it at probe time (measured:distro-cachyoscheck-cachyos-immich-podfailed one check of 123 with “pnpm 12.15.0 is UNMEASURED”). -
Workspace packages —
@immich/sdk→@immich/plugin-sdk→ server; the server has aworkspace:*dependency on@immich/plugin-sdk, so the order matters. -
Core plugin (WASM) —
packages/plugin-core(moved fromplugins/in v3), compiled with extism-js into/build/plugins/immich-plugin-core/{dist,manifest.json}. -
Server —
pnpm --filter immich build, thenpnpm --filter immich --prod --no-optional deploy /opt/immich/server, then the mandatory sharp rebuild against the system libvips (SHARP_FORCE_GLOBAL_LIBVIPS=true … --dir /opt/immich/server/node_modules/sharp exec npm run build). -
Web UI —
pnpm --filter immich-web build→/build/www; the build needs thei18n/tree present (web/package.jsonmaps#i18n/*to../i18n/*). -
Geodata —
admin1CodesASCII.txt,admin2Codes.txt,countryInfo.txt(NEW in v3 and required),cities500.zip→cities500.txt, and the Natural Earth country outline pinned to tagv5.1.2.geodata-date.txtis read unguarded at boot./build/build-lock.jsonships as a valid empty{"sources":[],"packages":[]}— the server only warns when the file is absent. -
Machine learning —
uv venv --python 3.13thenuv sync --frozen --no-dev --no-editable --active --link-mode copy --extra cuda --group cuda-libsinmachine-learning/, installed into/opt/immich/machine-learning/.venv.cudais an OPTIONAL-DEPENDENCY (--extra);cuda-libsis a DEPENDENCY GROUP (--group) — passing it as--extrafails with “Extracuda-libsis not defined in the project’s optional-dependencies table”. Together they make the venv self-contained with CUDA 12 runtime wheels, which is what an Arch/CachyOS base needs (its system CUDA is 13.x). ONNX Runtime’sCUDAExecutionProvideris a build-scope check, so a regression in the GPU stack turns red.The managed CPython must be installed outside root’s home (
UV_PYTHON_INSTALL_DIR), the venv is run through/opt/immich/ml-run.sh(which activates it and puts the wheellibdirs onLD_LIBRARY_PATH), and theimmich-mlservice overridesIMMICH_HOST/IMMICH_PORTbecauseimmich_mlreads those non-prefixed names. All three are load-bearing, not decoration: without them the ML backend is unreadable to the image’s uid-1000 user, cannot findgunicorn, or binds the server’s own port. -
PostgreSQL extensions —
/docker-entrypoint-initdb.d/01-immich-extensions.sqlseedsvector,vchord CASCADE,cubeandearthdistance CASCADEon firstinitdb;/usr/local/bin/immich-db-migrate.shre-ensures them idempotently on every start via theimmich-db-initservice. -
Server startup wrapper —
/usr/local/bin/immich-server-start.shwaits forpg_isready, then execsnode /opt/immich/server/dist/main.js. The.jsextension is required:server/package.jsonis"type": "module".
All pnpm steps export npm_config_cache / npm_config_store_dir under /tmp so a root
build leaves no root-owned files in the container user’s cache.
Secrets
Section titled “Secrets”| Name | Env Vars |
|---|---|
db-password |
DB_PASSWORD, POSTGRES_PASSWORD |
immich: candy: - '@github.com/opencharly/pod-immich'Used In Boxes
Section titled “Used In Boxes”distro-cachyos/box/immich-cdi(CachyOS CDI pod base) — the single Immich image; the ML backend it needs is the supervisedimmich-mlservice this candy declares.
Related Candies
Section titled “Related Candies”/charly-infrastructure:supervisord– process manager dependency/charly-coder:nodejs– Node.js runtime dependency (provides node; the Immich build uses its OWN pinned pnpm)/charly-infrastructure:postgresql– database dependency/charly-infrastructure:redis– cache dependency/charly-selkies:ffmpeg– FFmpeg multimedia (nonfree codecs) — required dependency/charly-infrastructure:vectorchord– VectorChord extension (auto-detected by the server; the migration script creates it when available)
When to Use This Skill
Section titled “When to Use This Skill”Use when the user asks about:
- Immich photo management setup
- Photo library configuration
- Immich database or Redis connectivity
- Port 2283 or
immich.localhostroute - Machine learning: face recognition, smart search, OCR (port 3003)
- Media processing (vips, ffmpeg, ExifTool)
Related
Section titled “Related”/charly-image:layer— candy authoring reference (charly.ymlschema, plan verbs, service declarations)/charly-check:check— declarative testing (check:block,charly check box,charly check live)

