This is an automated archive made by the Lemmit Bot.
The original was posted on /r/selfhosted by /u/TechHutTV on 2025-12-13 07:02:18+00:00.
A vast majority of people with a smartphone are, by default, uploading their most personal pictures to Google, Apple, Amazon, whoever. I firmly believe companies like this don't need my photos. You can keep that data yourself, and Immich makes it genuinely easy to do so.
We're going through the entire Docker Compose stack using Portainer, enabling hardware acceleration for machine learning, configuring all the settings I actually recommend changing, and setting up secure remote access so you can back up photos from anywhere.
Why Immich Over the Alternatives
Two things make Immich stand out from other self-hosted photo solutions. First is the feature set, it's remarkably close to what you get from the big cloud providers. You've got a world map with photo locations, a timeline view, face recognition that actually works, albums, sharing capabilities, video transcoding, and smart search. It's incredibly feature-rich software.
Immich features
Second is the mobile app. Most of those features are accessible right from your phone, and the automatic backup from your camera roll works great. Combining it with NetBird makes backing up your images quick and secure with WireGuard working for us in the background.
Immich hit stable v2.0 back in October 2025, so the days of "it's still in beta" warnings are behind us. The development pace remains aggressive with updates rolling out regularly, but the core is solid.
Hardware Considerations
I'm not going to spend too much time on hardware specifics because setups vary wildly. For some of the machine learning features, you might want a GPU or at least an Intel processor with Quick Sync. But honestly, those features aren't strictly necessary. For most of us CPU transcoding will be fine.
The main consideration is storage. How much media are you actually going to put on this thing? In my setup, all my personal media sits around 300GB, but with additional family members on the server, everything totals just about a terabyte. And with that we need room to grow so plan accordingly.
For reference, my VM runs with 4 cores and 8GB of RAM. The database needs to live on an SSD, this isn't optional. Network shares for the PostgreSQL database will cause corruption and data loss. Your actual photos can live on spinning rust or a NAS share, but keep that database on local SSD storage.
Setting Up Ubuntu Server
I'm doing this on Ubuntu Server running as a VM on Unraid. You don't have to use Unraid, as TrueNAS, Proxmox, and other solutions work great, or you can install Ubuntu directly on hardware. The process is close to the same regardless.
If you're installing fresh, grab the Ubuntu Server ISO and flash it with Etcher or Rufus depending on your OS. During installation, I typically skip the LVM group option and go with standard partition schemes. There's documentation on LVM if you want to read more about it, but I've never found it necessary for this use case.
The one thing you absolutely want to enable during setup is the OpenSSH server. Skip all the snap packages, we don't need them.
Once you're booted in, set a static IP through your router. Check your current IP with:
ip a
Then navigate to your router's admin panel and assign a fixed IP to this machine or VM. How you do this varies by router, so check your manual if needed. I set mine to immich.lan for convenience.
First order of business on any fresh Linux install is to update everything:
sudo apt update && sudo apt upgrade -y
Installing Docker
Docker's official documentation has a convenience script that handles everything. SSH into your server and run:
curl -fsSL https://get.docker.com/ -o get-docker.sh
sudo sh get-docker.sh
This installs Docker, Docker Compose, and all the dependencies. Next, add your user to the docker group so you don't need sudo for every command:
sudo usermod -aG docker $USER
newgrp docker
Installing Portainer
Note: Using Portainer is optional, it's a nice GUI that helps manage Docker containers. If you prefer using Docker Compose from the command line or other installation methods, check out the Immich docs for alternative approaches.
Portainer provides a web-based interface for managing Docker containers, which makes setting up and managing Immich much easier. First let's create our volume for the Portainer data.
docker volume create portainer_data
Spin up Portainer Community Edition:
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer-ce:latest
Once Portainer is running, access the web interface at https://your-server-ip:9443/. You'll be prompted to create an admin account on first login. The self-signed certificate warning is normal, just proceed.
https://preview.redd.it/1e5q24j76x6g1.jpg?width=3840&format=pjpg&auto=webp&s=023c44345a2ff8e5591d2f9ea65deb326ae44e06
That's the bulk of the prerequisites handled.
The Docker Compose Setup
Immich recommends Docker Compose as the installation method, and I agree. We'll use Portainer's Stack feature to deploy Immich, which makes the process much more visual and easier to manage.
- In Portainer, go to Stacks in the left sidebar.
- Click on Add stack.
- Give the stack a name (i.e.,
immich), and select Web Editor as the build method.
- We need to get the
docker-compose.yml file. Open a terminal and download it from the Immich releases page:
https://preview.redd.it/ph1uafov6x6g1.jpg?width=3840&format=pjpg&auto=webp&s=fa2db564e8f1ca62ccc547fc78fd3fbffc80866d
wget -O docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
cat docker-compose.yml
- Copy the entire contents of the
docker-compose.yml file and paste it into Portainer's Web Editor.
- Important: In Portainer, you need to replace
.env with stack.env for all containers that reference environment variables. Search for .env in the editor and replace it with stack.env.
- Now we need to set up the environment variables. Click on Advanced Mode in the Environment Variables section.
- Download the example environment file from the Immich releases page:
wget https://github.com/immich-app/immich/releases/latest/download/example.env
cat example.env
5. Copy the entire contents of the example.env file and paste it into Portainer's environment variables editor or upload it directly.
6. Switch back to Simple Mode and update the key variables:
https://preview.redd.it/mnqtp2jm6x6g1.jpg?width=3840&format=pjpg&auto=webp&s=07571a7db817c4a0ce44f9e1fbb30146a92dce98
The key variables to change:
- DB_PASSWORD: Change this to something secure (alphanumeric only)
- DB_DATA_LOCATION: Set to an absolute path where the database will be saved (e.g.,
/mnt/user/appdata/immich/postgres). This MUST be on SSD storage.
- UPLOAD_LOCATION: Set to an absolute path where your photos will be stored (e.g.,
/mnt/user/images)
- TZ: Set your timezone (e.g.,
America/Los_Angeles)
- IMMICH_VERSION: Set to
v2 for the latest stable version
For my setup, the upload location points to an Unraid share where my storage array lives. The database stays on local SSD storage. Adjust these paths for your environment.
Enabling Hardware Acceleration
If you have Intel Quick Sync, an NVIDIA GPU, or AMD graphics, you can offload transcoding from the CPU. You'll need to download the hardware acceleration configs and merge them into your Portainer stack.
First, download the hardware acceleration files:
wget https://github.com/immich-app/immich/releases/latest/download/hwaccel.transcoding.yml
wget https://github.com/immich-app/immich/releases/latest/download/hwaccel.ml.yml
For transcoding acceleration, you'll need to edit the immich-server section in your Portainer stack. Find the immich-server service and add the extends block. For Intel Quick Sync:
immich-server:
extends:
file: hwaccel.transcoding.yml
service: quicksync # or nvenc, vaapi, rkmpp depending on your hardware
However, since Portainer uses a single compose file, you'll need to either:
- Copy the relevant device mappings and environment variables from
hwaccel.transcoding.yml directly into your stack, or
- Use Portainer's file-based compose method if you have the files on disk
For machine learning acceleration with Intel, update the immich-machine-learning service image to use the OpenVINO variant:
immich-machine-learning:
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
And add the device mappings from hwaccel.ml.yml for the openvino service directly into the stack.
If you're on Proxmo...
Content cut off. Read original on https://old.reddit.com/r/selfhosted/comments/1plf8aa/self_hosted_immich_and_netbird_for_full_control/