Immich Server Setup Guide 

Immich Server Setup Guide
Technical Guide

Immich Server Setup Guide

Complete step-by-step instructions to set up an Immich server on Ubuntu 22.04 LTS with a 150 GB volume for storage. Immich is a self-hosted photo and video backup solution that provides an alternative to cloud-based services.

Prerequisites

Before starting, ensure you have:

A server running Ubuntu 22.04 LTS

Root or sudo privileges for administrative tasks

An active internet connection to download packages

An additional 150 GB volume attached to the server

Basic knowledge of Linux command-line interface (CLI)

A backup destination (external drive, cloud storage, or another server)

Step 1: Prepare the System

Update your system to ensure all packages are up to date.

sudo apt update && sudo apt upgrade -y

Step 2: Set Up the Volume

Format, mount, and configure the additional 150 GB volume to store Immich's data.

1. Identify the Extra Volume:

lsblk

2. Format the Volume (Warning: This erases all data on the volume):

sudo mkfs.ext4 /dev/xvdb

3. Create a Mount Point:

sudo mkdir /mnt/immich_data

4. Mount the Volume:

sudo mount /dev/xvdb /mnt/immich_data

5. Verify the Mount:

df -h /mnt/immich_data

6. Make the Mount Persistent by adding to /etc/fstab:

sudo blkid /dev/xvdb
sudo nano /etc/fstab

Add this line to /etc/fstab (replace UUID with your volume's UUID):

UUID=<your-uuid-here> /mnt/immich_data ext4 defaults,nofail 0 2

7. Set Permissions:

sudo chown -R 1000:1000 /mnt/immich_data
sudo chmod -R 755 /mnt/immich_data

Step 3: Install Docker and Docker Compose

1. Add Docker's Official GPG Key:

sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

2. Add the Repository to Apt Sources:

echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

3. Install Docker and Docker Compose:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Step 4: Set Up Immich

1. Create and navigate to Immich directory:

mkdir ./immich-app
cd ./immich-app

2. Download Docker Compose and .env files:

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

3. Edit the .env file with key settings:

nano .env

# Update these values:
UPLOAD_LOCATION=/mnt/immich_data/upload
DB_DATA_LOCATION=/mnt/immich_data/db
TZ=Asia/Kolkata

4. Create directories and set permissions:

sudo mkdir -p /mnt/immich_data/upload /mnt/immich_data/db
sudo chown -R 1000:1000 /mnt/immich_data
sudo chmod -R 755 /mnt/immich_data

5. Start Immich:

docker compose up -d

Step 5: Verify Installation

Access the Immich web interface at http://<your-server-ip>:2283

Create an admin account and configure Immich

Verify that data directories are being populated

Important Notes

Regularly back up the /mnt/immich_data directory

Monitor Docker container logs:

docker compose logs

For updates, pull latest images and restart:

docker compose pull && docker compose up -d

This setup ensures a robust Immich server for managing your photos and videos with persistent storage on your 150GB volume.

Immich Server SSL Setup