Guideschevron_rightServers

Servers · 9 min read · Updated

How to Self-Host Immich for Your Photos

To self-host Immich, a photo and video backup app in the style of Google Photos, download its docker-compose.yml and example.env from the latest release, set the library and database folders and a database password, run docker compose up -d, and put Caddy in front for HTTPS. Immich needs at least 6 GB of memory (8 GB recommended), its database on local SSD storage, and as much disk as your library. Then install the phone app and turn on backup.

Which Server Size for Immich

Memory decides whether Immich runs well; storage decides how big a library fits.

Server plans compared with Immich's requirements
PlanMemoryStorageFor ImmichPrice
Bronze VPS6 GB75 GBMeets the 6 GB minimum$37.50/mo
Silver VPS8 GB100 GBMeets the 8 GB recommendation$46.50/mo
Gold VPS12 GB150 GBMeets the 8 GB recommendation$60.00/mo
Diamond VPS16 GB200 GBMeets the 8 GB recommendation$73.50/mo
Platinum VPS24 GB300 GBMeets the 8 GB recommendation$100.00/mo
AMD Ryzen 9 5950X dedicated128 GB2x 1TB NVMeMeets the 8 GB recommendation$399.00/mo

A family library of a few hundred gigabytes fits a larger VPS; terabytes of photos and video fit a dedicated server, whose fast cores also make face recognition and video transcoding quicker.

1. Prepare the Server

On Ubuntu 24.04, secure the server and install Docker. Point an A record such as photos.example.com at it, and allow ports 80 and 443.

2. Download and Configure Immich

mkdir ~/immich-app && cd ~/immich-app
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
nano .env

In .env, check these lines:

UPLOAD_LOCATION=./library        # where photos and videos are stored
DB_DATA_LOCATION=./postgres      # keep on the server's own disk, never a network share
DB_PASSWORD=change-me-letters-and-digits-only
TZ=America/New_York              # uncomment and set your time zone

Use only letters and digits in the database password, as Immich's example file asks. Leave IMMICH_VERSION as it came with the release.

3. Keep the Web Port Private

Docker opens published ports past ufw, as explained in why ufw does not block Docker ports. In docker-compose.yml, find the ports: line of the immich-server service (2283 in current releases) and bind it to the server itself, so only Caddy can reach it:

    ports:
      - "127.0.0.1:2283:2283"
docker compose up -d
docker compose ps        # every service should be running or healthy

4. Add HTTPS With Caddy

sudo apt install -y caddy
sudo tee /etc/caddy/Caddyfile >/dev/null <<'EOF'
photos.example.com {
    reverse_proxy 127.0.0.1:2283
}
EOF
sudo systemctl reload caddy

Caddy fetches and renews the certificate by itself. Open https://photos.example.com, create the administrator account, then add accounts for your family under Administration → Users.

5. Connect Your Phone

Install the Immich app, enter https://photos.example.com as the server, sign in and turn on backup. The first upload of a large camera roll takes a while and counts toward your plan's monthly transfer; see what 1 TB of bandwidth means.

6. Back It Up Off the Server

Immich keeps daily database dumps in UPLOAD_LOCATION/backups (14 by default), but it does not back up your files. Copy the whole UPLOAD_LOCATION folder, which includes those dumps, to another place every night, and follow the 3-2-1 rule Immich recommends: a storage box with Borg works well, as only new photos are sent each night.

Update with docker compose pull && docker compose up -d after reading the release notes.

Common Questions

  • How much RAM does Immich need?

    Immich lists 6 GB as the minimum and 8 GB as recommended, with 2 cores minimum and 4 recommended. It can run in 4 GB with the machine-learning features (face recognition and smart search) turned off.

  • How much storage do I need?

    As much as your photo and video library, plus room for thumbnails and transcoded videos Immich creates, and for growth. Check the size of your library first; phones that shoot 4K video fill storage quickly.

  • Can the library live on network storage?

    Immich says its database should be on local SSD storage and never on a network share. Keep the database on the server's own disk; for a library too big for the server, choose a server with more local storage.

  • Does the phone app back up automatically?

    Yes. Sign in to your server from the Immich app on iOS or Android and turn on backup; it uploads new photos and videos in the background, much like the big cloud photo services.

Plans and prices

VPS Plans

KVM servers on NVMe storage: your photo library on a server you control, in Ashburn or Dallas.

See all plans
  • Bronze

    3 vCPU · 6 GB RAM · 75 GB NVMe

    2 TB transfer

    $37.50/mo

    Configure inAshburnDallas
  • Silver

    4 vCPU · 8 GB RAM · 100 GB NVMe

    4 TB transfer

    $46.50/mo

    Configure inAshburnDallas
  • Gold

    6 vCPU · 12 GB RAM · 150 GB NVMe

    6 TB transfer

    $60.00/mo

    Configure inAshburnDallas
  • Diamond

    8 vCPU · 16 GB RAM · 200 GB NVMe

    8 TB transfer

    $73.50/mo

    Configure inAshburnDallas

Network port: 10 Gbps in Ashburn, VA, 50 Gbps in Dallas, TX. Pick the location when you configure.

Keep Reading

All guides