DebianDebian Based

How To Install Immich on Debian 12

Install Immich on Debian 12

Immich is a powerful, self-hosted photo and video management solution that offers a secure and private alternative to cloud services like Google Photos. Hosting Immich on Debian 12 provides a robust and stable environment, ensuring your media is well-managed and accessible. This comprehensive guide will walk you through the process of installing Immich on Debian 12, covering everything from prerequisites to post-installation steps.

What is Immich?

Immich is an open-source application designed for managing and organizing personal photos and videos. It leverages modern technologies to provide features such as high-performance media handling, machine learning support for categorization and search, and seamless synchronization across devices.

Key Features of Immich include:

  • Self-hosted solution ensuring privacy and control over your data.
  • Efficient media management with support for large libraries.
  • Machine learning capabilities for intelligent categorization and search.
  • Accessible via web interface and mobile applications.
  • Cost-effective alternative to commercial cloud services.

By choosing to self-host Immich on Debian 12, users benefit from enhanced privacy, greater control over their data, and the flexibility to customize the setup according to their needs.

Prerequisites for Installing Immich on Debian 12

Before diving into the installation process, ensure that your system meets the necessary requirements and that you have the essential tools and permissions in place.

System Requirements

  • CPU: Intel i5 or equivalent.
  • RAM: Minimum 4 GB, 6 GB recommended.
  • Storage: Sufficient space for media files and system operations.
  • Optional GPU Support: For enhanced machine learning performance, a compatible GPU with CUDA support is recommended.

Software Requirements

  • Operating System: Debian 12 (Bookworm) with regular updates.
  • Node.js: Version 20 LTS installed via NVM (Node Version Manager).
  • Docker: Docker Engine installed for containerization.
  • Docker Compose: Essential for orchestrating Docker containers.

Dependencies

  • CuDNN and CUDA Toolkit: Required for machine learning support, especially if utilizing GPU acceleration.
  • Essential Packages: Tools like curl, wget, nano, and git should be installed.

System Updates

Ensure your Debian system is up-to-date to prevent conflicts and ensure compatibility with the latest packages.

sudo apt update && sudo apt upgrade -y

Step-by-Step Guide to Install Immich on Debian 12

This section provides a detailed, step-by-step guide to installing Immich on Debian 12. Follow each step carefully to ensure a smooth installation process.

1. Preparing the Environment

Start by updating your system and installing essential tools. Creating a dedicated user for Immich enhances security and organization.

sudo apt update && sudo apt upgrade -y
sudo apt install curl wget nano git -y
sudo adduser immich

Switch to the newly created user:

su immich

2. Installing Node.js and NVM

Immich requires a recent version of Node.js. Installing Node Version Manager (NVM) facilitates managing different Node.js versions.

# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

# Load NVM
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

# Install Node.js 20 LTS
nvm install 20

# Verify installations
node -v
npm -v

If necessary, restart your terminal or source your profile to apply changes.

source ~/.bashrc

Exit back to the root user:

exit

3. Installing Docker and Docker Compose

Docker is essential for containerizing the Immich application. Docker Compose helps manage multi-container Docker applications.

# Install Docker
sudo apt install docker.io -y

# Start and enable Docker service
sudo systemctl start docker
sudo systemctl enable docker

# Add immich user to Docker group
sudo usermod -aG docker immich

# Install Docker Compose
sudo apt install docker-compose -y

# Verify Docker installation
docker --version
docker-compose --version

4. Setting Up CuDNN and CUDA Toolkit (Optional)

If you plan to utilize machine learning features with GPU acceleration, installing CuDNN and the CUDA Toolkit is necessary.

Run the following commands as the root user:

# Download CUDA keyring
wget https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb

# Install CUDA keyring
sudo dpkg -i cuda-keyring_1.1-1_all.deb

# Update package lists
sudo apt-get update

# Install CuDNN and CUDA Toolkit
sudo apt-get -y install libcudnn-cuda-12 libcublaslt12 libcublas12

Verify GPU support:

nvidia-smi

If you don’t have a compatible GPU or prefer not to use machine learning features, you can skip this step.

5. Configuring Immich with Docker Compose

Create a project directory and set up the Docker Compose configuration.

mkdir ~/immich && cd ~/immich

# Create docker-compose.yml
nano docker-compose.yml

Paste the following configuration into the docker-compose.yml file:

version: '3.8'

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:release
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - "2283:3001"
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:release
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: redis
    image: redis:6
    restart: always

  database:
    container_name: postgres
    image: postgres:13
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: your_secure_password
      POSTGRES_DB: immich
    volumes:
      - postgres-data:/var/lib/postgresql/data
    restart: always

volumes:
  model-cache:
  postgres-data:

Create and configure the .env file:

nano .env

Insert the following environment variables, customizing paths and passwords as needed:

UPLOAD_LOCATION=./upload
DB_DATA_LOCATION=./postgres
IMMICH_VERSION=release
DB_PASSWORD=your_secure_password
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

6. Running Immich Services

Start the Immich containers using Docker Compose:

docker-compose up -d

Verify that all containers are running:

docker ps

Ensure that immich_server, immich_machine_learning, redis, and postgres containers are active.

Post Installation Steps

After successfully installing Immich, perform the following steps to complete the setup and start managing your media.

Accessing the Web Interface

Open your web browser and navigate to:

http://localhost:2283

If accessing from a different machine, replace localhost with your server’s IP address.

Install Immich on Debian 12

Registering the Admin User

Click on the Getting Started button. Fill in the registration form to create the admin account. This account will have the authority to add additional users and manage the Immich server.

Testing Immich Features

Once logged in, test key features:

  • Upload photos and videos through the web interface.
  • Utilize the search and categorization features powered by machine learning.
  • Explore synchronization options with mobile applications.

Troubleshooting Common Issues

Encountering issues during installation is common. Here are solutions to some frequent problems:

Docker Permission Issues

If you face permission errors while running Docker commands, ensure the immich user is added to the Docker group:

sudo usermod -aG docker immich

Then, log out and log back in for the changes to take effect.

Node.js Version Conflicts

Immich requires Node.js 20 LTS. Verify the installed version:

node -v

If the version is incorrect, reinstall Node.js using NVM:

nvm install 20
nvm use 20

GPU Configuration Errors

For machine learning features, CUDA and CuDNN must be correctly installed. Verify GPU support using:

nvidia-smi

If errors persist, consult NVIDIA’s official documentation for troubleshooting CUDA installations.

Checking Logs for Debugging

Inspect container logs to identify issues:

docker logs 

Replace <container_name> with the name of the problematic container, such as immich_server.

Congratulations! You have successfully installed Immich. Thanks for using this tutorial for installing Immich ultimate photo Backup on Debian 12 “Bookworm” system. For additional help or useful information, we recommend you check the official Immich website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button