Hands-on VPS & self-hosting Monday, June 1, 2026
VPS.app
Hands-on VPS benchmarks and self-hosting guides — tested, not theorized.
Self-Hosting Guides

How to Self-Host Immich on a VPS (Google Photos Alternative, 2026)

Some links below are affiliate links: if you buy through them I may earn a commission at no extra cost to you. I only recommend what I have actually tested, and it never changes my verdict.

Self-hosted photo library on a server

Immich is the closest open-source project to a full Google Photos replacement: automatic phone backup, a scrollable timeline, albums, shared libraries, and — the part that sets it apart from simpler gallery apps — on-device AI search and face grouping. It is heavier than something like Vaultwarden or Nextcloud Notes, so the VPS you pick matters more here than for most self-hosted software.

Why self-host Immich?

  • You own the photos. No subscription, no account deletion risk, no terms-of-service changes. Your library lives on hardware you control.
  • No per-gigabyte bill. A VPS with a large attached volume costs a flat monthly rate. Once the disk is paid for, adding another 10,000 photos costs nothing extra.
  • AI search and faces, locally. Immich ships a machine-learning service that indexes every photo for semantic search (“photos from the beach in 2024”) and clusters faces into albums — all running on your server, not in someone else’s cloud.

The honest trade-off: you maintain it. Immich ships updates frequently, sometimes with database migrations that require a careful upgrade path. The ML service also wants RAM — plan for it.

Prerequisites

  • A VPS with 4 GB RAM or more and disk sized to your library. See Best VPS for Self-Hosting for a current comparison. If you are also running local AI workloads, Best VPS for Local LLM covers the RAM/GPU angle in detail.
  • A domain or subdomain (e.g. photos.yourdomain.com). Follow Point a Domain to Your VPS if you have not done this yet.
  • Docker and Docker Compose installed on the server.

Step 1 — Use the official Compose file

Immich pins specific image versions and depends on a special pgvector-enabled PostgreSQL image. If you hand-write a compose file you will almost certainly get the database image wrong, which breaks ML search. Always start from the files the project publishes:

mkdir immich && cd immich
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

This gives you the exact image tags the current release was tested against. When you upgrade later, repeat the same wget for the new release and diff the .env to carry over your settings.

Step 2 — Configure .env

Open .env in your editor. Two variables are required before the first start:

  • UPLOAD_LOCATION — the path on the host where photos will be stored, e.g. /mnt/photos/library. Make sure the volume has room.
  • DB_PASSWORD — a strong, randomly generated password for the internal PostgreSQL database. Write it down; you will need it if you ever restore from backup.

Everything else (ports, timezone, log level) can stay at its default for now.

Step 3 — Start it

docker compose up -d

The first start downloads several container images and then the ML model (several hundred megabytes). Expect the full stack to be ready in two to five minutes depending on your server’s internet speed. Watch progress with:

docker compose logs -f immich-server

When you see the server reporting it is listening, open http://your-server-ip:2283 in a browser to create the admin account.

Step 4 — HTTPS and the mobile app

Exposing Immich directly on port 2283 is fine for testing, but the mobile app requires HTTPS for automatic backup. Set up a reverse proxy:

  1. Follow the Nginx Proxy Manager setup guide to install NPM alongside Immich.
  2. Add a proxy host pointing photos.yourdomain.com to immich-server:3001 (the internal Docker network address) and issue a Let’s Encrypt certificate.
  3. Install the Immich app on iOS or Android, enter your https://photos.yourdomain.com URL, log in, and enable Background Backup.

After the initial backup completes — which can take hours for a large library — new photos will sync automatically in the background.

Troubleshooting

Out of memory during ML indexing. The machine-learning service can exhaust RAM on a 4 GB VPS while processing a large library. Add a swap file (fallocate -l 4G /swapfile && mkswap /swapfile && swapon /swapfile) to give it breathing room, or comment out the immich-machine-learning service in docker-compose.yml entirely if you do not need AI search.

Uploads fail or time out. Your reverse proxy is almost certainly enforcing a default body-size limit. In Nginx Proxy Manager, open Advanced for the proxy host and add client_max_body_size 0; to allow unlimited upload size.

Container won’t start after a fresh deploy. The most common cause is a mismatch between DB_PASSWORD in .env and whatever password was used when the database volume was first created. If the volume already exists with a different password, either delete the volume (losing data) or correct the password in .env to match.

Search returns no results even after a day. The ML service indexes photos in the background and can take hours on a large library. Check progress with docker compose logs immich-machine-learning. If the container restarted mid-index due to OOM, add swap and let it resume — it picks up where it left off.

Which VPS to run Immich on

Immich is one of the few self-hosted apps where skimping on RAM will actively hurt the experience. The ML service needs headroom, and the PostgreSQL instance with the pgvector extension adds to the memory footprint.

Hetzner offers the best RAM-per-euro in Europe — a 4 GB instance starts from around €4–5/mo (check current pricing). For a managed experience where patching and backups are handled for you, Cloudways is worth the premium.

For a full comparison including disk options and locations, see Best VPS for Self-Hosting. If you are building a home-lab stack that also runs local AI models, Best VPS for Local LLM covers the RAM and GPU considerations that apply equally to Immich’s ML service.

Once Immich is running, self-hosting Nextcloud is a natural complement — it handles documents, calendars, and contacts while Immich owns the photo library.

Frequently asked questions

What VPS specs does Immich need?

More than most self-hosted apps, because of the machine-learning features (search, faces). Aim for 4 GB RAM or more, and plenty of disk for your photo library. 2 GB can work if you disable ML.

Does Immich really replace Google Photos?

For backup, timeline, albums, sharing, AI search and face grouping — yes, very closely, with mobile apps for iOS and Android. You trade Google's convenience for full ownership.

Should I use the official Immich compose file?

Yes. Immich moves fast and pins specific image tags and a special database image, so always start from their official docker-compose.yml and .env rather than a hand-written one.

Can I run Immich on 2 GB RAM?

Technically yes, but the machine-learning service will frequently OOM-kill. Either add swap (helps somewhat) or disable the ML container entirely in docker-compose.yml. Without ML you still get backup, timeline, and albums — just no AI search or face grouping.

How do I update Immich?

Pull the new compose file and .env from the release page, compare to your current .env to carry over your settings, then run docker compose pull && docker compose up -d. Immich upgrades frequently, so pin to a release rather than latest in production.