Files
oam/knowledge base/immich.md
2024-08-18 12:13:43 +02:00

2.1 KiB

Immich

Self-hosted photo and video management solution.

  1. TL;DR
  2. Further readings
    1. Sources

TL;DR

Setup
curl -O 'https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml' \
&& curl -o '.env' 'https://github.com/immich-app/immich/releases/latest/download/example.env' \
&& curl -O 'https://github.com/immich-app/immich/releases/latest/download/hwaccel.transcoding.yml' \
&& curl -O 'https://github.com/immich-app/immich/releases/latest/download/hwaccel.ml.yml' \
&& docker compose up -d \
&& xdg-open 'http://localhost:2283'

The composition uses .env for configuration.
Refer the Environment Variables documentation page for the available environment variables.

Usage
# Backup the DB.
docker exec -t 'immich_postgres' pg_dumpall --clean --if-exists --username='postgres' \
| gzip > '/path/to/backup/dump.sql.gz'

# Restore the DB.
# The procedure deletes *all* data to start from scratch.
source '.env' \
&& docker compose down -v \
&& rm -rf "$DB_DATA_LOCATION" \
&& docker compose create \
&& docker start 'immich_postgres' && sleep 10 \
&& gunzip < '/path/to/backup/dump.sql.gz' \
  | sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
  | docker exec -i 'immich_postgres' psql --username='postgres' \
&& docker compose up -d

Further readings

Sources