VPS

How to Self-Host Immich on a VPS: Your Own Google Photos, Step by Step

17 min read

How to Self-Host Immich on a VPS: Your Own Google Photos, Step by Step

The Short Answer

Immich is the self-hosted Google Photos replacement that actually feels like Google Photos — mobile auto-upload, face recognition, smart search, shared albums and a timeline — running on a server you control. It installs as a four-container Docker Compose stack (server, machine learning, Redis and PostgreSQL with pgvector), listens on port 2283, and needs more server than most self-hosted apps: 6 GB of RAM minimum, 8 GB recommended, with 2 CPU cores minimum and 4 recommended, per Immich’s official requirements page, checked November 30, 2026. A 4 GB VPS can run it only with machine learning switched off, which removes face recognition and smart search. Budget your photo library’s size plus 10–20% for thumbnails and transcoded video, keep the database on local SSD (never a network share), put HTTPS in front before the mobile app touches it, and back up both the database and the photo files — copying only the photos leaves a library Immich cannot read. This guide walks through sizing, installation, HTTPS, phone setup and backups, with the failure points named up front so you size the VPS once, correctly.

The appeal is obvious: your camera roll stops living on someone else’s cloud, on someone else’s terms, at a monthly storage price that only goes up. The cost is equally obvious once you read the requirements honestly: Immich is not a 1 GB side project. It is a small database-backed service with a machine-learning worker attached, and it behaves like one. Treat it that way and it is one of the most satisfying self-hosted services you can run. Treat it like a lightweight file share and you will meet the out-of-memory killer during your first big import.

What Immich Is (and What It Replaces)

Immich is an open-source, self-hosted photo and video management system with web, Android and iOS apps. The phone apps back up selected albums automatically (Wi-Fi only by default), the server organizes everything into a timeline, and the machine-learning container adds the two features that make a large library usable: face recognition (grouping photos by person) and CLIP-based smart search (finding “beach sunset” without manual tags). Shared albums, partner sharing, geolocation maps and duplicate detection round out the feature set that earns it the “self-hosted Google Photos” label in nearly every review.

It helps to place Immich next to the other self-hosted staples. If Nextcloud is your files, Immich is your photos — the same Docker-plus-reverse-proxy shape, a very different workload. Files sit still; photos get processed. Every upload is thumbnailed, every video may be transcoded, and every asset is run through face detection and embedding models. That processing is why Immich’s floor is 6 GB of RAM while a file sync server can idle happily in 1–2 GB. If you are choosing hardware for both, our best VPS for self-hosting roundup covers the general sizing logic, and the best VPS for Nextcloud guide covers the files side; this article is the photos side, with Immich’s own numbers.

One honest limit before the install steps: Immich gives you feature parity with a cloud photo service, not operational parity. Google Photos has a team keeping your library alive; with Immich, that team is you. Updates, backups, disk-full alerts and the occasional breaking change are yours. The rest of this guide is written so that job stays small — but it never reaches zero.

Sizing the VPS: The Official Numbers

Immich publishes its requirements plainly, and they are worth quoting exactly because so many tutorials soften them. From the official requirements page (docs.immich.app/install/requirements), checked November 30, 2026:

  • Operating system: 64-bit Linux recommended (Ubuntu, Debian and similar). Non-Linux hosts are strongly discouraged; the project says support on them will be severely reduced.
  • RAM: minimum 6 GB, recommended 8 GB. Systems with only 4 GB can run Immich with machine-learning features disabled.
  • CPU: minimum 2 cores, recommended 4 cores, on amd64 or arm64. Since version 3, the machine-learning container on amd64 requires the x86-64-v2 microarchitecture level — most CPUs released since roughly 2012 qualify; if yours does not, the last compatible release is v2.7.5, which is no longer supported.
  • Storage: a Unix-compatible filesystem with real user/group permissions (EXT4, ZFS and similar). Thumbnails and transcoded video add 10–20% on top of your library size. The PostgreSQL database files are typically 1–3 GB and should use local SSD storage, never a network share of any kind. If you apply Docker resource limits, the database alone needs at least 2 GB of RAM.
  • Software: Docker with the Compose plugin. The command is docker compose; the old docker-compose binary is deprecated and no longer supported by Immich.
Setup RAM CPU Machine learning Who it suits
Documented minimum 6 GB 2 cores On, at minimum spec One person, modest library, patient first scan
Documented recommended 8 GB 4 cores On, comfortable Family library, several phones backing up daily
Small-VPS compromise 4 GB 2 cores Off (no faces, no smart search) Timeline + backup only; upgrade path when budget allows
Large library 16 GB 6–8 cores On, with headroom Years of photos, 4K video, multiple users

Translate that into a buying decision. A personal library of 100 GB of photos needs roughly 110–120 GB of disk before growth; a 500 GB family archive needs 550–600 GB, which on most VPS plans means attaching a storage volume rather than relying on the boot disk. The database, though, stays on the local SSD — Immich’s docs are explicit that network-backed Postgres has caused corruption, so the split is: database and application on local disk, photo library on the big volume. CPU matters most during the first import: face recognition and smart-search indexing of a large library on 2 cores can run for hours in the background. That is normal, not a hang — new uploads are processed as they arrive once the backlog clears. A GPU is optional; CPU processing works, hardware acceleration only makes the first scan and video transcoding faster.

Also plan for the version you will run. Immich reached its first stable release (v2.0.0) in October 2025 and moved to the v3 line in July 2026, with v3.4.x current in November 2026. The project ships breaking changes often enough that the release notes are part of the upgrade procedure, not optional reading — pin a specific version in your .env file instead of tracking release, and upgrade deliberately.

Step 1: Prepare the Server

Start with a 64-bit Linux VPS at the recommended size if you can — 4 vCPU and 8 GB of RAM is the configuration that makes the first import boring, and boring is good. Install Docker Engine with the Compose plugin from Docker’s own repository (our how to install Docker on a VPS walkthrough covers the Ubuntu path), and confirm both commands answer:

docker --version
docker compose version

Two preparation details save real pain later. First, add swap even on an 8 GB box: the machine-learning container loads CLIP and face-recognition models into memory, and a memory spike during a bulk upload is the single most common Immich failure on small servers — swap turns an out-of-memory kill into a slow minute. Second, decide where things live before you download anything: a project directory (for example /opt/immich) for the Compose file and database, and your library directory on the volume with room to grow. If the library sits on a separate mount, make sure Docker starts after that mount is ready, or Immich will happily start against an empty directory and look like data loss.

Point a subdomain at the server now — photos.yourdomain.com with a DNS A record to the VPS address. You will need it for HTTPS in step 3, and DNS propagation is free waiting time if you start it before the install instead of after.

Step 2: Install Immich with Docker Compose

Immich’s official install path is two files from the current release plus one command. Use the project’s files, not a Compose file copied from a blog (including this one): the project pins its service and database images inside those files, and they change between versions.

mkdir -p /opt/immich && cd /opt/immich
curl -L https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml -o docker-compose.yml
curl -L https://github.com/immich-app/immich/releases/latest/download/example.env -o .env

Edit .env before starting anything. Set UPLOAD_LOCATION to your library directory, set a strong DB_PASSWORD, set TZ to your timezone, and pin IMMICH_VERSION to a specific release tag rather than leaving it floating — a pinned version means docker compose pull can never surprise you with a breaking change at 2 a.m. Then bring the stack up:

docker compose up -d
docker compose ps

Four containers should come up: immich-server (the application and API), immich-machine-learning (faces and smart search), a Redis cache, and PostgreSQL with the pgvector extension pre-installed. The server listens on port 2283. Open http://<server-ip>:2283 from your network, create the admin account, and confirm the timeline loads. If the machine-learning container keeps restarting on a small box, you have found the RAM floor the hard way: either move to the 6–8 GB size or disable machine learning in the settings and accept a backup-and-timeline service without faces or smart search. Do not paper over it with resource limits below the documented floors — the database alone wants 2 GB when limits are applied.

Importing an existing library deserves one warning: the database stores every file path and is never rebuilt by scanning the library folder. Copying photos into the upload directory by hand does not register them. Use the web upload, the mobile apps, or Immich’s external-library feature (which mounts an existing folder read-only via a volume entry in the Compose file) — and expect the first scan of a large library to take hours on CPU. Start it, let it run, and check progress in the admin jobs view rather than restarting containers that are merely busy.

Step 3: Put HTTPS in Front (Not Optional for Phones)

Port 2283 on a public IP is a demo, not a deployment. The mobile app strongly prefers — and in practice expects — an HTTPS endpoint, and your photo library deserves encryption on the wire regardless. Put a reverse proxy in front of Immich: Caddy is the shortest path (automatic certificates with a two-line site block proxying to localhost:2283), and Nginx with Certbot or Traefik work equally well if you already run them. The pattern is the same one we use for other self-hosted services — see the reverse-proxy section of how to self-host n8n on a VPS for the general shape — with two Immich-specific notes: raise the proxy’s maximum upload size (phone videos are large; a default 1 MB limit will fail uploads in confusing ways), and allow long request timeouts for big files on slow connections.

Once HTTPS answers on your subdomain, close the direct port: bind Immich to 127.0.0.1:2283 in the Compose file (or firewall 2283 to localhost) so the proxy is the only public door. If only your household will ever reach the server, a VPN-only setup is the other sane option — no public exposure at all — but understand the trade: phones outside the VPN stop backing up until they reconnect. For most people, public HTTPS with a strong admin password and closed public registration (create your accounts, then disable sign-ups in the admin settings) is the right balance.

Step 4: Connect the Phones

Install the Immich app on Android or iOS, enter your server URL (https://photos.yourdomain.com), and sign in with the account you created. Enable backup, select the albums to include, and leave the default Wi-Fi-only restriction on for the first sync — the initial upload of a full camera roll over mobile data is a bill, not a backup. The app shows per-album status and remaining counts; let the first pass finish on home Wi-Fi with the phone plugged in.

Then verify the features that justify the RAM: open a photo and confirm faces are being detected (people appear under the Explore tab once indexing catches up), and try a smart search like “dog” or “beach” once the embedding jobs complete. If search returns nothing after the jobs finish, the machine-learning container is not running — check docker compose ps and its logs before changing settings. Multi-user households get one account per person, with partner sharing for a combined timeline and shared albums for the rest; each user’s uploads land in their own library, which is exactly the separation a family archive wants.

Step 5: Backups — the Part That Decides Whether This Was a Good Idea

Immich’s own guidance is a 3-2-1 backup strategy for your photos, and the detail that catches people out is that there are two things to back up, not one: the original photo and video files and the PostgreSQL database. The database holds the library’s structure — file paths, albums, faces, search embeddings, sharing state. Restore the files without the database and you have a folder of images Immich cannot read as a library; restore the database without the files and you have a beautiful index of missing photos. Back up both, on a schedule, to somewhere that is not the same disk: a second volume, object storage, or another machine. A simple pattern is a nightly database dump (pg_dump inside the database container, or Immich’s built-in database backup in newer versions) plus a file-level sync of the upload directory, with the whole set copied off-server.

Test the restore once, before you need it: spin the stack up against a copy of the backup on a spare directory or a throwaway VPS and confirm the timeline loads with photos visible. An untested backup is a hope, and photo libraries are precisely the data people cannot recreate. Also watch disk growth: thumbnails, transcoded videos and new uploads compound, and a full disk stops uploads silently from the phone’s point of view. A monthly glance at disk usage — or an alert at 80% — is part of running this service, the same discipline as any database-backed app on your server.

Updating Without Breaking It

Immich ships breaking changes often enough that “pull latest and restart” is how self-hosters lose weekends. The safe rhythm is: read the release notes for the version you are moving to, back up the database, update the pinned IMMICH_VERSION in .env, then docker compose pull && docker compose up -d and watch the logs until the server reports healthy. Mobile apps and server versions occasionally need to move together, so update the phone apps in the same window. If an update does go wrong, your pre-update database backup plus the old pinned version is the rollback — which is why the backup in step 5 comes before the upgrade habit, not after.

Who Should Run Immich on a VPS — and Who Should Not

Run it if you have 6–8 GB of RAM to give it (or a 4 GB box and no need for faces or smart search), a library whose size you can state in gigabytes, and a backup destination that is not the same disk. You get a genuinely private photo cloud with the features that made the cloud version sticky, at a fixed server cost instead of a growing storage subscription.

Think twice if your only available server is a 1–2 GB VPS, your library is multiple terabytes with no storage volume budget, or nobody in the household will ever check that backups ran. In those cases a managed photo service — or a home server with big local disks, which is where most large Immich installs actually live — fits better than a cramped VPS. And if what you really want is files plus photos in one place, weigh Immich against running Nextcloud’s photo features instead; the dedicated tool is better at photos, the general tool is one less service to maintain. Our best VPS for a Plex media server guide covers the neighboring media-server sizing if video streaming is also on your list.

FAQ

How much RAM does Immich really need?
The official minimum is 6 GB with 8 GB recommended, on 2 CPU cores minimum and 4 recommended. A 4 GB system can run Immich with machine-learning features disabled — no face recognition and no smart search. Nothing below 4 GB is documented, and the machine-learning container is the first thing the kernel kills on an undersized box.

Can I run Immich on a 2 GB VPS?
No — not in any documented configuration. Even the reduced 4 GB setup disables machine learning, and the database alone wants 2 GB when Docker resource limits are applied. A 2 GB server will OOM-kill containers during uploads. Size up, or offload machine learning to another machine.

How much disk space should I budget?
Your library’s current size plus 10–20% for thumbnails and transcoded video, plus 1–3 GB for the database, plus growth. A 200 GB collection lands around 221–243 GB on day one; a 500 GB archive needs 550–600 GB. Keep the database on local SSD and put the library on a storage volume if it outgrows the boot disk.

Does the database really have to stay off network storage?
Yes. Immich’s requirements say the PostgreSQL files should ideally use local SSD and never a network share of any kind, and the project has documented corruption from NFS-backed databases. Library files can live on a mounted volume; the database cannot.

Why does the mobile app refuse to connect?
Usually HTTPS. The app expects a proper HTTPS endpoint via a reverse proxy, with the exact server URL you configured. Check that your subdomain resolves, the certificate is valid, the proxy passes large uploads (raise the body-size limit), and that you are not pointing the app at the raw http://<ip>:2283 address from outside your network.

What happens if I only back up the photo files?
You lose the library. The database stores every file path, album, face grouping and search index, and Immich does not rebuild it by scanning the folder. Back up the database and the files together, off-server, and test a restore before you trust it.

How do I update Immich safely?
Pin a version in .env, read the release notes, back up the database, then pull and restart. Immich ships breaking changes regularly, and mobile app versions sometimes need to match the server. The pinned version plus the pre-update backup is your rollback.

The Bottom Line

Self-hosting Immich on a VPS is a sizing decision first and an install second. The install itself is two official files and docker compose up -d; the decisions that determine whether it still works in a year are the 6–8 GB of RAM (4 GB only without machine learning), the library-plus-20% disk budget with the database kept on local SSD, HTTPS in front of port 2283 before any phone connects, and a tested backup of both the database and the photos. Get those four right and you have a private Google Photos — auto-upload, faces, smart search and shared albums — on infrastructure you control, at a fixed cost. Get the sizing wrong and no amount of tuning will save the first big import. Size it like the database-backed, ML-processing service it is, and Immich is one of the best reasons to own a server at all.

Sources: Immich official requirements (docs.immich.app/install/requirements), checked November 30, 2026 — 64-bit Linux recommended; RAM minimum 6 GB, recommended 8 GB; CPU minimum 2 cores, recommended 4 cores (amd64/arm64; since v3 the machine-learning container on amd64 requires x86-64-v2, most CPUs since ~2012; last x86-64-v1 release v2.7.5, unsupported); thumbnails/transcoded video add 10–20% to library size; PostgreSQL files typically 1–3 GB, local SSD, never a network share, at least 2 GB RAM if Docker limits are used; 4 GB systems can run with machine learning disabled; Docker with the Compose plugin required (docker compose, not docker-compose). Immich install documentation and release files (github.com/immich-app/immich releases: docker-compose.yml + example.env; server on port 2283; four-container stack: immich-server, immich-machine-learning, Redis, PostgreSQL/pgvector), checked November 30, 2026. Immich release history via project releases and coverage checked November 30, 2026 — first stable v2.0.0 October 2025; v3 line from July 2026; v3.4.x current November 2026; optional product key pricing not relied on for this guide. No VPS provider prices are quoted in this article — sizing is given in specs from Immich’s own documentation so readers can price any provider against them. Server News Hub coverage linked above: Best VPS for Self-Hosting 2026, Best VPS for Nextcloud 2026, How to Install Docker on a VPS, How to Self-Host n8n on a VPS, and Best VPS for a Plex Media Server 2026.

Leave a Reply

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