summaryrefslogtreecommitdiff
path: root/immich
diff options
context:
space:
mode:
Diffstat (limited to 'immich')
-rw-r--r--immich/.env.example24
-rw-r--r--immich/README.md31
-rwxr-xr-ximmich/backup.sh26
-rwxr-xr-ximmich/docker-compose.yml76
4 files changed, 157 insertions, 0 deletions
diff --git a/immich/.env.example b/immich/.env.example
new file mode 100644
index 0000000..a7e4255
--- /dev/null
+++ b/immich/.env.example
@@ -0,0 +1,24 @@
+# You can find documentation for all the supported env variables at https://docs.immich.app/install/environment-variables
+
+# The location where your uploaded files are stored
+UPLOAD_LOCATION=/srv/photos
+
+# The location where your database files are stored. Network shares are not supported for the database
+DB_DATA_LOCATION=./postgres
+
+# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
+TZ=America/Los_Angeles
+
+# The Immich version to use. You can pin this to a specific version like "v2.1.0"
+IMMICH_VERSION=v2
+
+# Connection secret for postgres. You should change it to a random password
+# Please use only the characters `A-Za-z0-9`, without special characters or spaces
+DB_PASSWORD=your_db_password_here
+
+# The values below this line do not need to be changed
+###################################################################################
+DB_USERNAME=postgres
+DB_DATABASE_NAME=immich
+
+IMMICH_VERSION=v3
diff --git a/immich/README.md b/immich/README.md
new file mode 100644
index 0000000..788372a
--- /dev/null
+++ b/immich/README.md
@@ -0,0 +1,31 @@
+# Immich
+
+Self-hosted photo and video management solution.
+
+## Setup
+
+1. Copy `.env.example` to `.env`:
+ ```
+ cp .env.example .env
+ ```
+
+2. Edit `.env`:
+ - Set `DB_PASSWORD` to a secure random string.
+ - Set `UPLOAD_LOCATION` to where you want photos stored.
+ - Set `DB_DATA_LOCATION` to where you want the database stored (avoid network shares).
+ - Set `TZ` to your timezone.
+
+3. Start:
+ ```
+ docker compose up -d
+ ```
+
+## Access
+
+- Web UI: `http://<host>:2283`
+
+## What to Configure
+
+- **`.env`** — All primary configuration lives here. See the [Immich docs](https://docs.immich.app/install/environment-variables) for all options.
+- **Hardware acceleration** — Uncomment the `extends` sections in `docker-compose.yml` for transcoding/ML hardware acceleration.
+- **`backup.sh`** — Example borg backup script for database and photo backups. Edit the paths and remote host to match your setup before using.
diff --git a/immich/backup.sh b/immich/backup.sh
new file mode 100755
index 0000000..91770a9
--- /dev/null
+++ b/immich/backup.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Paths
+UPLOAD_LOCATION="/srv/photos"
+BACKUP_PATH="/path/to/local/immich-backup"
+REMOTE_HOST="user@remote-host"
+REMOTE_BACKUP_PATH="/path/to/remote/immich"
+
+
+### Local
+
+# Backup Immich database
+docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=postgres > "$UPLOAD_LOCATION"/database-backup/immich-database.sql
+# For deduplicating backup programs such as Borg or Restic, compressing the content can increase backup size by making it harder to deduplicate. If you are using a different program or still prefer to compress, you can use the following command instead:
+# docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=<DB_USERNAME> | /usr/bin/gzip --rsyncable > "$UPLOAD_LOCATION"/database-backup/immich-database.sql.gz
+
+### Append to local Borg repository
+borg create "$BACKUP_PATH/immich-borg::{now}" "$UPLOAD_LOCATION" --exclude "$UPLOAD_LOCATION"/thumbs/ --exclude "$UPLOAD_LOCATION"/encoded-video/
+borg prune --keep-weekly=4 --keep-monthly=3 "$BACKUP_PATH"/immich-borg
+borg compact "$BACKUP_PATH"/immich-borg
+
+
+### Append to remote Borg repository
+borg create "$REMOTE_HOST:$REMOTE_BACKUP_PATH/immich-borg::{now}" "$UPLOAD_LOCATION" --exclude "$UPLOAD_LOCATION"/thumbs/ --exclude "$UPLOAD_LOCATION"/encoded-video/
+borg prune --keep-weekly=4 --keep-monthly=3 "$REMOTE_HOST:$REMOTE_BACKUP_PATH"/immich-borg
+borg compact "$REMOTE_HOST:$REMOTE_BACKUP_PATH"/immich-borg
diff --git a/immich/docker-compose.yml b/immich/docker-compose.yml
new file mode 100755
index 0000000..2dd1a7f
--- /dev/null
+++ b/immich/docker-compose.yml
@@ -0,0 +1,76 @@
+#
+# WARNING: To install Immich, follow our guide: https://docs.immich.app/install/docker-compose
+#
+# Make sure to use the docker-compose.yml of the current release:
+#
+# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
+#
+# The compose file on main may not be compatible with the latest release.
+
+name: immich
+
+services:
+ immich-server:
+ container_name: immich_server
+ image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
+ # extends:
+ # file: hwaccel.transcoding.yml
+ # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
+ volumes:
+ # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
+ - ${UPLOAD_LOCATION}:/data
+ - /etc/localtime:/etc/localtime:ro
+ env_file:
+ - .env
+ ports:
+ - '2283:2283'
+ depends_on:
+ - redis
+ - database
+ restart: always
+ healthcheck:
+ disable: false
+
+ redis:
+ container_name: immich_redis
+ image: docker.io/valkey/valkey:9@sha256:3b55fbaa0cd93cf0d9d961f405e4dfcc70efe325e2d84da207a0a8e6d8fde4f9
+ healthcheck:
+ test: redis-cli ping || exit 1
+ restart: always
+
+ immich-machine-learning:
+ container_name: immich_machine_learning
+ # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
+ # Example tag: ${IMMICH_VERSION:-release}-cuda
+ image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
+ # extends: # uncomment this section for hardware acceleration - see https://docs.immich.app/features/ml-hardware-acceleration
+ # file: hwaccel.ml.yml
+ # service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
+ volumes:
+ - model-cache:/cache
+ env_file:
+ - .env
+ restart: always
+ healthcheck:
+ disable: false
+
+ 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'
+ # Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
+ # DB_STORAGE_TYPE: 'HDD'
+ volumes:
+ # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
+ - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
+ shm_size: 128mb
+ restart: always
+ healthcheck:
+ disable: false
+
+volumes:
+ model-cache: