메인 콘텐츠로 바로가기

Docker Compose [추천]

Docker Compose는 프로덕션 환경에서 Immich를 실행하기 위한 추천 방법입니다. 아래는 Docker Compose를 사용하여 Immich를 배포하는 단계입니다.

Step 1 - Download the required files

Create a directory of your choice (e.g. ./immich-app) to hold the docker-compose.yml and .env files.

Move to the directory you created
mkdir ./immich-app
cd ./immich-app

Download docker-compose.yml and example.env by running the following commands:

Get docker-compose.yml file
wget -O docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
Get .env file
wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env

You can alternatively download these two files from your browser and move them to the directory that you created, in which case ensure that you rename example.env to .env.

Step 2 - Populate the .env file with custom values

Default environmental variable content
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=./library

# 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=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# 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=postgres

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
  • Populate UPLOAD_LOCATION with your preferred location for storing backup assets. It should be a new directory on the server with enough free space.
  • Consider changing DB_PASSWORD to a custom value. Postgres is not publicly exposed, so this password is only used for local authentication. To avoid issues with Docker parsing this value, it is best to use only the characters A-Za-z0-9. pwgen is a handy utility for this.
  • Set your timezone by uncommenting the TZ= line.
  • Populate custom database information if necessary.

Step 3 - Start the containers

From the directory you created in Step 1 (which should now contain your customized docker-compose.yml and .env files), run the following command to start Immich as a background service:

Start the containers
docker compose up -d
Docker 버전

unknown shorthand flag: 'd' in -d 또는 open <location of your .env file>: permission denied와 같은 오류가 발생하면 잘못된 Docker 버전을 실행 중일 가능성이 있습니다. (예를 들어, Ubuntu 22.04.3 LTS에서 docker.io 패키지로 인해 발생할 수 있습니다.) 문제를 해결하려면 해당 배포판에 대한 Docker Engine 설치 절차를 완전히 따르고, 특히 "이전 버전 제거" 및 "apt/rpm 저장소를 사용하여 설치" 섹션에 따라 작업하세요. 이 절차는 배포판의 Docker 패키지를 Docker의 공식 패키지로 대체합니다.

docker-compose가 아니라 docker compose 명령이 올바른 명령이라는 것을 주의하세요. 기본 Ubuntu 22.04에서 후자를 시도하면 아래와 같은 다른 방식으로 실패합니다:

The Compose file './docker-compose.yml' is invalid because:
'name' does not match any of the regexes: '^x-'

이전에 언급한 공식 Docker 저장소에서 설치하는 방법에 대한 내용을 참조하세요.

Health check 시작 간격

can’t set healthcheck.start_interval as feature require Docker Engine v25 or later라는 오류가 발생하면, docker-compose.yml 파일의 database 섹션에서 start_interval 줄을 주석 처리하는 데 도움이 됩니다.

다음 단계

설치 후 단계업그레이드 지침을 읽으세요.