Home > Software > How to Deploy Immich with Docker Compose: A Complete Guide

How to Deploy Immich with Docker Compose: A Complete Guide

Anastasios Antoniadis

Discover the comprehensive guide to deploying Immich, the self-hosted photo and video backup solution, using Docker Compose. Follow our step-by-step instructions to set up Immich seamlessly, ensuring your memories are securely backed up.

Docker (1)

Immich is an open-source, self-hosted photo and video backup solution akin to Google Photos, but with the privacy and control that come with self-hosting. Leveraging the powerful features of Docker Compose, deploying Immich on your own server can be straightforward and efficient. This guide will walk you through setting up Immich using Docker Compose, ensuring you have a robust, private platform for backing up your precious memories.

Prerequisites

Before starting, make sure you have the following:

  • Docker installed on your server.
  • Docker Compose installed on your server.
  • Basic familiarity with Docker and Docker Compose concepts.

Step 1: Create a Docker Compose File

First, create a directory dedicated to your Immich deployment. This directory will house your Docker Compose file (docker-compose.yml) and any additional configuration files or directories you might need.

mkdir immich-docker && cd immich-docker

Create the docker-compose.yml file:

touch docker-compose.yml

Open this file in a text editor and add the following configuration:

version: '3.8'
services:
  immich-app:
    image: immich-app:latest
    container_name: immich_app
    ports:
      - "8080:8080"
    environment:
      DB_HOST: immich-db
      DB_PORT: 5432
      DB_USER: immich
      DB_PASSWORD: securepassword
      DB_NAME: immich_db
    depends_on:
      - immich-db

  immich-db:
    image: postgres:13-alpine
    container_name: immich_db
    environment:
      POSTGRES_USER: immich
      POSTGRES_PASSWORD: securepassword
      POSTGRES_DB: immich_db
    volumes:
      - immich_db_data:/var/lib/postgresql/data

volumes:
  immich_db_data:

Configuration Explained:

  • immich-app: Configures the Immich application service. The DB_* environment variables are used to connect the application to its PostgreSQL database. The depends_on attribute ensures that the immich-db service is started before immich-app.
  • immich-db: Sets up a PostgreSQL database for Immich. The POSTGRES_* environment variables define the database user, password, and database name, which must match those provided to immich-app.
  • volumes: Persists the database data using a named volume (immich_db_data), ensuring that your data is retained across container restarts.

Step 2: Launch Immich

With your docker-compose.yml file ready, start the Immich services by running:

docker compose up -d

This command pulls the necessary Docker images and starts the Immich application and database containers in detached mode.

Step 3: Access Immich

After a few moments, Immich will be up and running. You can access the Immich web interface by navigating to http://your-server-ip:8080 in a web browser. You can create an account and start backing up your photos and videos from there.

Conclusion

Deploying Immich with Docker Compose offers a streamlined method for setting up a private, self-hosted photo and video backup platform. By following the steps outlined in this guide, you can quickly get an Immich instance running on your own server. This gives you full control over your data while enjoying the convenience and features similar to cloud-based solutions. Docker Compose simplifies the management of Immich services, making maintenance and updates more manageable as you continue to safeguard your digital memories.

Anastasios Antoniadis
Follow me
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x