Setting up Immich using Docker

In this tutorial, we will show you how to run Immich using Docker.

Immich Docker

Immich is a self-hosted solution for backing up your photos and videos from your phone. It is designed to be a self-hosted alternative to services such as Google Photos and iCloud.

It has many features you expect from other services such as a useful web interface where you can easily browse and manage your photos and videos. Immich even has apps for both Android and iPhone.

You can even view additional information, such as where photos were taken (Assuming it has the correct metadata) and group photos based on facial recognition.

Immich is one of the most feature-packed self-hosted solutions for managing and uploading your photos, and thanks to Docker, it is also very easy to get up and running.

Using Docker to run Immich makes setting up this image backup solution a much simpler process. It also makes updating all of the various parts of this software as simple as running a couple of different commands.

We will be using the official Immich Compose file and Docker containers as they help ensure all the required services are up and running. They are also constantly updated when changes have been made to the core services.

Installing and Using Immich using Docker

Over the following sections, we will walk you through the simple steps of using the Immich Docker container on your device. Setting up this software is relatively easy, thanks to the way the Immich team provides their official Compose file.

These steps should work on almost all Linux-based systems that Docker supports.

Installing Docker on your Device

1. Before we can set up Immich in a Docker container, we must install the Docker runtime on our system. If you already have Docker installed, skip to step 4.

The easiest way to install Docker on a Linux-based system such as Ubuntu is to utilize the following command.

curl -sSL https://get.docker.com | sh

2. Once Docker has installed to your system, you will want to add your current user to the “docker” group. You can add your user to this group by running the command below.

Adding your user to this group will allow you to control Docker without having to escalate privileges.

sudo usermod -aG docker $USER

3. Since we have changed our user’s groups, you will need to log off and on again for it to take effect.

If you are using the terminal or SSH you can easily log out by running the following command.

logout

Alternatively, you can restart your system completely by using the command below.

sudo reboot

Preparing your Device to run Immich using Docker

4. With Docker installed, we can start preparing your device to run the Immich Docker container.

Our first step is to create a directory where we will store the Compose and environment files for Immich.

sudo mkdir -p /opt/stacks/immich

5. You will now want to change to the directory we created by running the command below.

cd /opt/stacks/immich

Grabbing the Docker Compose file for Immich

6. Since Immich has quite a large Compose file, we will download the one attached to the latest release.

This file basically has everything we need set up. We just need to feed in information using the ".env” environment file.

Download this Compose file by using the following command in your terminal.

sudo curl -Lo compose.yaml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml

Configuring the Environment File for Immich using Docker

7. Our next step is to grab the example environment file for Immich’s Docker container.

You can grab this example file and store it as a file called “.env” by running the command below.

sudo curl -Lo .env https://github.com/immich-app/immich/releases/latest/download/example.env

8. With the example environment file now saved, we will need to modify it so the Immich Docker container will save files to where you want on your system.

You should have an idea of where you want all of your photos and videos to be stored before continuing.

Once you are happy to proceed, begin editing the “.env” file by using the following command.

sudo nano .env

a. The first option in this file is where you will specify where your images and videos are backed up to on your device.

Replace “./library” with the path to where you want your images and files stored by Immich.

UPLOAD_LOCATION=./library

b. The next option you might want to adjust is the “IMMICH_VERSION“. You can change “release” to pin to a specific version of the Immich Docker container.

For most users, you are better off leaving this set to “release“. Leaving this set to release means you will always get the latest tagged release.

IMMICH_VERSION=release

c. The final option you must set is the DB password. Replace “postgres” with a unique password of your choosing.

Ensure this is secure, as it is the password Immich will use to communicate with the Postgres database that is being set up within the same Compose file.

DB_PASSWORD=postgres

9. After making changes to the file, save and quit by pressing CTRL + X, Y, then ENTER.

Starting Immich using Docker

10. With the Compose and environment files now written, you can start up your Immich Docker container by using the following command.

This process can take a few minutes as Docker must download Immich and its various components.

docker compose up -d

Accessing the Immich Web Interface

11. To access your Immich web interface, you will want to know the IP address of your machine.

You can get your machine to output its assigned IP address by using the hostname command. On a home network this is typically a local IP address such as “192.168.0.123

hostname -I

12. Once you know your IP address, you will want to go to the following URL in your favourite web browser.

Ensure that you replace “<IPADDRESS>” with your IP.

http://<IPADDRESS>:2283

First Time Setup Experience

13. The first time you access the Immich web interface, you must go through some initial setup steps.

To get started with this initial setup, click the “Getting Started” button.

Getting Started with Immich

14. Your first step is to create an admin account that you will use to manage your Immich Docker installation.

Fill out the details for your account (1.). Ensure you set a secure password, as this will give someone full access to your installation.

After filling out the details for your account, click the “Sign up” button (2.).

Create admin account for Immich Docker container

15. After creating your account, you will need to log in to proceed. Fill in the email and password you set in the previous step (1.).

Once you have typed out your username and password, click the “Login” button (2.).

Login to new Admin Account

16. You will now see a welcome screen and a message saying you need to set up some common settings.

To continue with the setup process, click the “Theme” button.

Welcome to setup for Immich Docker

17. This first setting allows you to choose whether to use a light or dark theme with Immich.

Select whichever theme you prefer, then click the “Storage Template” button.

Choose theme

18. Within this next screen, you can set up a storage template. The storage template tells Immich how you handle the images and videos you upload.

Before proceeding, we highly recommend reading the official documentation on storage templates.

After working out whether you need to set up a storage template, click the “Done” button to continue.

Set up of Immich completed

19. At this point you now have Immich successfully running through a Docker container.

You can now browse the web interface and learn how it works.

Immich set up using Docker Container

Updating your Immich Docker Container

Since we are using a Docker container to run Immich, keeping the software up to date is a relatively straightforward process.

This section will walk you through updating your version of Immich to the latest stable release.

1. We first need to change to the directory where we saved the Docker Compose file for Immich.

You can change to this directory by using the following command.

cd /opt/stacks/immich

2. After changing to the right directory, you can get Docker to pull the latest version by running the command below.

Docker will scan the Compose file and pull new images for each container specified within the file.

docker compose pull

3. If Docker downloaded a new version, you only need to run the command below to upgrade to it.

Running this command will detect if any changes have occurred and restart your containers using the new version of the images.

docker compose up -d

Conclusion

You should now have the Immich photo and backup solution up and running on your device.

This software allows you to easily upload all your photos to a single location while providing many smart features offered by cloud solutions like Google Photos and iCould.

Please leave a comment below if you have issues getting Immich to run using the Docker container.

If you found our tutorial to be helpful, we recommend checking out our many other tutorials.

Leave a Reply

Your email address will not be published. Required fields are marked *