📸 My Immich Setup#
This Immich setup runs in a Docker container to provide a self-hosted photo and video management solution. It includes essential services such as the Immich server, machine learning module, Redis, and PostgreSQL database.
⚙️ My Configuration Details#
🌍 Environment Variables#
Variable | Description |
---|---|
UPLOAD_LOCATION=./library | Directory for storing uploaded files |
DB_DATA_LOCATION=./postgres | Directory for database storage |
IMMICH_VERSION=release | Defines the version of Immich to use |
DB_PASSWORD=postgres | PostgreSQL connection password |
DB_USERNAME=postgres | PostgreSQL username |
DB_DATABASE_NAME=immich | PostgreSQL database name |
📂 Volume Mounts#
Volume | Description |
---|---|
${UPLOAD_LOCATION}:/usr/src/app/upload | Stores uploaded media files |
${THUMB_LOCATION}:/usr/src/app/upload/thumbs | Stores generated thumbnails |
${ENCODED_VIDEO_LOCATION}:/usr/src/app/upload/encoded-video | Stores transcoded videos |
${PROFILE_LOCATION}:/usr/src/app/upload/profile | Stores user profile images |
${BACKUP_LOCATION}:/usr/src/app/upload/backups | Stores backup files |
${DB_DATA_LOCATION}:/var/lib/postgresql/data | Stores PostgreSQL database files |
/etc/localtime:/etc/localtime:ro | Maintains time synchronization |
model-cache:/cache | Caches machine learning models |
🔗 Networking#
Port Mapping | Function |
---|---|
2283:2283 | Immich server web interface |
📜 My Docker Compose Configuration#
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- ${THUMB_LOCATION}:/usr/src/app/upload/thumbs
- ${ENCODED_VIDEO_LOCATION}:/usr/src/app/upload/encoded-video
- ${PROFILE_LOCATION}:/usr/src/app/upload/profile
- ${BACKUP_LOCATION}:/usr/src/app/upload/backups
- /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/redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5
healthcheck:
test: redis-cli ping || exit 1
restart: always
database:
container_name: immich_postgres
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
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
healthcheck:
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1
interval: 5m
start_interval: 30s
start_period: 5m
command:
[
"postgres",
"-c",
"shared_preload_libraries=vectors.so",
"-c",
"search_path=$$user, public, vectors",
"-c",
"logging_collector=on",
"-c",
"max_wal_size=2GB",
"-c",
"shared_buffers=512MB",
"-c",
"wal_compression=on",
]
restart: always
volumes:
model-cache:
🛠 Immich Environment Variables Configuration#
You can find documentation for all the supported environment variables in the official Immich documentation.
🗂 Configuration Variables#
UPLOAD_LOCATION:
The location where your uploaded files are stored.
Default:./library
DB_DATA_LOCATION:
The location where your database files are stored.
Default:./postgres
TZ:
The timezone setting for Immich. Uncomment the next line and changeEtc/UTC
to a valid timezone identifier from this list.
Example:TZ=Europe/London
IMMICH_VERSION:
The version of Immich to use.
Default:release
You can pin it to a specific version like"v1.71.0"
.DB_PASSWORD:
The connection secret for PostgreSQL.
Change this to a random password for security.
Ensure that only A-Za-z0-9 characters are used, without special characters or spaces.
Example:DB_PASSWORD=yourSecurePassword
🔑 Default Database Credentials#
The following credentials do not need to be changed unless you want to customize the setup:
- DB_USERNAME:
postgres
- DB_DATABASE_NAME:
immich
📚 Documentation Links#
This configuration ensures your Immich instance has the correct settings for file storage, database credentials, timezone, and version control.