Back to articles

Installing Docker and Immich on Ubuntu with a Windows Photo Share

Install Docker and Immich on Ubuntu, connect a Windows photo share, and back up photos from your phone to your own server.

In this guide, I’ll walk through the setup from my video: installing Docker on Ubuntu, connecting a Windows file share, and installing Immich to back up photos from my phone.

Immich gives you a photo library you host yourself, with features such as mobile uploads, face recognition, maps, and album sharing. In my setup, Ubuntu runs Immich, while my Windows server stores the photos and videos.

Below are the commands I used, along with explanations so you can follow along.

My setup

I’m connected to my Ubuntu machine over SSH. These are the addresses and names used in the instructions:

SettingMy value
Ubuntu server192.168.1.115
Windows server192.168.1.37
Windows sharePhotos
SMB usernamemikko
Ubuntu mount point/mnt/mars-photos

Replace these with the values for your own setup. The Windows share should already exist, and the account you use must have permission to write to it.

1. Install Docker

If you already have Docker and the Compose plugin installed, skip to the next section.

First, update the package index and install the required tools:

sudo apt update
sudo apt install -y ca-certificates curl openssl

Add Docker’s official signing key and package repository:

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

sudo tee /etc/apt/sources.list.d/docker.sources >/dev/null <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF

Install Docker Engine and the Compose plugin, then enable and start Docker:

sudo apt update

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

sudo systemctl enable --now docker

Check that everything works:

sudo docker run --rm hello-world
sudo docker compose version

The first command downloads and runs a small test container. If you see the confirmation message, Docker is ready.

2. Connect the Windows share

My Windows server already holds my files, so I use it for Immich’s photo storage too.

We’ll mount the Windows share at /mnt/mars-photos on Ubuntu. This makes the remote folder accessible through a local path, while the files themselves are stored on the Windows server.

Install SMB support

sudo apt update
sudo apt install -y cifs-utils

Create the credentials file

Create a protected file for the Windows share credentials:

sudo install -d -m 755 /etc/samba
sudo install -m 600 /dev/null /etc/samba/credentials-mars
sudo nano /etc/samba/credentials-mars

Add these lines, replacing the username and password with your own:

username=mikko
password=your_smb_password

Save the file with Ctrl+O, press Enter, then exit with Ctrl+X.

Set the ownership and permissions:

sudo chown root:root /etc/samba/credentials-mars
sudo chmod 600 /etc/samba/credentials-mars

This limits access to the credentials file to root.

Create the mount point

sudo mkdir -p /mnt/mars-photos
sudo chown mikko:mikko /mnt/mars-photos

In the second command, replace mikko:mikko with your Ubuntu username and group.

Make the mount persistent

Adding the share to /etc/fstab lets Ubuntu reconnect it after a restart.

Back up the file before editing it:

sudo cp -a /etc/fstab "/etc/fstab.backup-$(date +%Y%m%d-%H%M%S)"
sudo nano /etc/fstab

Add the following as one line at the end:

//192.168.1.37/Photos /mnt/mars-photos cifs credentials=/etc/samba/credentials-mars,uid=1000,gid=1000,forceuid,forcegid,file_mode=0664,dir_mode=0775,vers=3.0,iocharset=utf8,_netdev,nofail,x-systemd.automount,x-systemd.device-timeout=10s 0 0

Replace the Windows server address and share name as needed. The uid=1000 and gid=1000 values should match the Ubuntu user and group that need access.

Save the file, then reload the configuration and mount the share:

sudo systemctl daemon-reload
sudo mount -a
ls -la /mnt/mars-photos

You should see the contents of your Windows share.

Test that you can create and remove a file:

touch /mnt/mars-photos/.write-test
rm /mnt/mars-photos/.write-test

If both commands complete without errors, write access is working.

3. Create the Immich configuration

Now we can install Immich using Docker Compose.

Create a directory and open a new Compose file:

mkdir -p ~/immich
cd ~/immich
nano compose.yaml

Leave the editor open and visit the Immich website in your browser.

As shown in the video:

  1. Open Download.
  2. Use the Compose configuration builder.
  3. Set the library location to:
   /mnt/mars-photos
  1. Copy the generated Compose configuration.
  2. Return to the terminal and paste it into compose.yaml.

The library path must exactly match the mount point we created earlier, including the leading /.

In the video, I initially entered a different folder name and corrected it. Double-check that the generated configuration contains /mnt/mars-photos before saving.

Save with Ctrl+O, press Enter, and exit with Ctrl+X.

4. Start Immich

Run the following from your Immich directory:

cd ~/immich
sudo docker compose up -d

Docker will download the images and start Immich and its supporting services, including the machine-learning service.

The -d option runs the containers in the background. Automatic startup after a reboot depends on the restart settings in the Compose configuration.

Check the containers:

sudo docker ps

Give the services time to start. Some may initially show that their health checks are still starting.

5. Open the web interface

Open your Ubuntu server’s IP address in a browser, using port 2283.

In my setup, the address is:

http://192.168.1.115:2283

Create your account and go through the initial setup. I selected dark mode and British English, then reviewed the available preferences.

Once you reach the dashboard, you can upload a photo using the Upload button.

In my video, the storage indicator showed the larger Windows drive rather than the small disk assigned to Ubuntu. That was a useful sign that Immich was seeing the mounted storage.

You can also explore Account Settings and Administration. I left most settings as they were, but it’s worth checking what fits your own setup.

6. Optional: use a custom domain

I already use local DNS in UniFi and Nginx Proxy Manager in my home lab, so I added a domain for Immich.

For this guide, I’ll use the example hostname:

photos.example.com

Replace it with your own hostname when configuring your setup.

In UniFi, create a local DNS entry pointing that hostname to the IP address of Nginx Proxy Manager.

Then, in Nginx Proxy Manager, add a proxy host with these settings:

SettingValue
Domain namephotos.example.com
Schemehttp
Forward IP address192.168.1.115
Forward port2283
WebSocket supportEnabled

I enabled WebSocket support so the web interface could communicate properly with the server, including its connection status.

In the SSL settings, select your existing certificate for your hostname and enable Force SSL.

After saving, open Immich using your HTTPS address. With the example hostname, that would be:

https://photos.example.com

This part uses the DNS and reverse-proxy setup already running in my home lab. You can continue using the server’s IP address if you haven’t configured those services.

7. Set up the mobile app

Install Immich from the App Store or Google Play.

When you open the app, enter your server address. For the direct connection in this example, use:

http://192.168.1.115:2283

If you configured a custom domain, enter your HTTPS address instead:

https://photos.example.com

Replace the example hostname with your own, then sign in with the account you created in the web interface.

The photo uploaded through the browser should now appear in the app.

Select the photos to back up

Open the backup section using the cloud icon shown in the video.

Before enabling backup, open the settings using the gear icon and review the mobile-data options. If you have a limited data plan, you may want to keep photo and video uploads over cellular disabled.

Next, select the albums or folders you want to back up and enable backup.

For the video, I used a small test album with ten photos. As the uploads completed, the app showed their backup status.

I then opened Immich on my Mac and checked that the same photos appeared in the web interface.

8. Explore the photo features

With the photos uploaded, I tried a few features.

Under Explore, Immich grouped the photos containing my face together. Processing can take a little time after uploading, so the results may not appear immediately.

The map also showed where my photos were taken when they included location data. In my test, those photos appeared in Finland.

You can share albums with other people and create additional accounts for family members to upload their own photos.

There’s more to explore, but those were the features I wanted to demonstrate in this video.

Accessing my library away from home

I also use Tailscale, which I covered in my previous video.

With my existing Tailscale and home-network configuration, I can access the same photo domain while travelling and upload photos from my phone.

That connection is encrypted and can travel over the internet, while Immich remains accessible through my private network setup.

For me, the main benefit is having photos uploaded to my own server as I go. If something happens to my phone, the photos that have already finished uploading are still available at home.

That’s the setup from the video: Docker and Immich on Ubuntu, photo storage on my Windows server, and access through the browser and mobile app.