Immich 自託管實測:四個容器約佔 2.4 GB RAM
Self-host Immich: I measured what Google Photos replacement actually costs in RAM
作者實際部署 Immich,量得四個容器處理完 5 張相片後的整體 RAM 工作集約 2.4 GB,ML 處理期間峯值約 5 GB。測試中,CPU 智能搜尋以「sunset over water」找到正確相片並排第 1,耗時 2.2 s;移除 ML 服務仍可上載及瀏覽,但會失去智能搜尋和人臉辨識。作者建議預留 4 GB 以上可用 RAM,並備份相片資料夾及 pg_dump。
DEV Community
0 Add reaction
0 Like
0 Unicorn
0 Exploding Head
0 Raised Hands
0 Fire
0 Jump to Comments 0 Save Boost
Pick as gem
Copy link
Copied to Clipboard
Share to XShare to LinkedInShare to FacebookShare to Mastodon
karthik Posted on Oct 30•Originally published at freetierwatch-eax.pages.dev
Self-host Immich: I measured what Google Photos replacement actually costs in RAM
#selfhosted#docker#photos#opensource
Originally published on FreeTierWatch, where we actually deploy and measure what we write about.
Immich is the self-hosted Google Photos replacement — 115,000+ GitHub stars, mobile apps with automatic backup, face recognition, and ML-powered search ("sunset over water" actually finds your sunset photos). It's the app that convinced a generation of self-hosters that leaving Google Photos was possible.
It's also the heaviest thing we've deployed in this series. Where Vaultwarden runs in 14 MB and Uptime Kuma in ~150 MB, Immich is a four-container stack that wants gigabytes. We deployed it, uploaded photos, ran the ML search, and measured what it really costs.
What you need (honestly)
- 4 GB+ free RAM — our measured working set was ~2.4 GB across the stack, with spikes during ML processing
- ~5 GB disk before any photos — the images alone total 4.7 GB
- Docker + Compose, 20 minutes
- Not a 1 GB VPS. This is the app the free Oracle ARM VM (12 GB RAM) was made for
Step 1: the official Compose stack
Immich ships its own Compose file — use it rather than hand-rolling:
mkdir immich && cd immich
curl -LO https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
curl -L -o .env https://github.com/immich-app/immich/releases/latest/download/example.env
Edit .env before starting — two changes are non-optional:
# generate a real DB password (alphanumeric only — special chars break it)
DB_PASSWORD=$(openssl rand -hex 16)
# set your timezone or every photo's date will be UTC
TZ=Asia/Kolkata
Also note UPLOAD_LOCATION=./library — point this at your biggest disk; it's where every photo lives.
docker compose up -d
First start pulled 4.7 GB of images (server 2.44 GB, machine-learning 1.1 GB, Postgres-with-vector-extensions 989 MB, Valkey 180 MB) and took ~2.5 minutes on our connection. Then open http://localhost:2283, create the admin account, and click through onboarding.
What it costs to run (measured)
| Container | RAM (settled, 5 photos processed) | Notes |
|---|---|---|
| immich_server | 962 MB | Peaked at 1.3 GB during initial processing |
| immich_machine_learning | 928 MB | ~200 MB idle; balloons when generating embeddings |
| immich_postgres | 465 MB | Vector-enabled Postgres (pgvecto.rs/VectorChord) |
| immich_redis (Valkey) | 14 MB | |
| Total working set | ~2.4 GB |
| Other metrics | Measured |
|---|---|
| Images on disk | 4.7 GB |
| Database size (5 photos) | 330 MB (ML models + vector indexes dominate) |
| Upload speed | 5 photos (470 KB avg) in 235 ms via API |
| ML smart search | "sunset over water" → correct photo ranked #1, 2.2 s on CPU |
| Server restart to ready | 5 s |
The headline: the machine-learning magic is real and runs fine on CPU — but it's why this stack needs several GB of RAM where a plain photo gallery would need 200 MB. That's the trade: Google-Photos-grade search, Google-Photos-grade resource bill (except you pay in RAM, not rupees).
Gotchas we hit or verified
- DB password charset: special characters in
DB_PASSWORDbreak the connection string — the env file warns you; believe it. Alphanumeric only. - The compose file changes between releases. Immich moves fast (it only recently left "breaking changes any week" beta culture). Always re-download the compose file from the release you're upgrading to — don't just
docker compose pull. - ML is optional but on by default. On a weak machine you can remove the
immich-machine-learningservice entirely — uploads and browsing work; you lose smart search and face recognition. - Mobile backup needs HTTPS or same-network HTTP. For remote access, put it behind a reverse proxy with TLS, or better: Tailscale — don't expose a photo library to the open internet.
- The database is not disposable. Unlike our other guides where the data volume was a convenience, here Postgres holds all metadata, albums, faces, and edits. Back up BOTH the
libraryfolder AND apg_dump— the official docs have a backup guide; follow it before you load 20,000 photos, not after.
When NOT to self-host Immich
- Under 4 GB of spare RAM — it will run badly or not at all. This is the one app in our series where the free-tier PaaS options are all non-starters; it needs a real machine.
- Your photos currently live only on your phone. Until your Immich server itself is backed up (3-2-1: the library folder + DB dump, off-site), it's not a backup — it's a second copy on hardware you administer. Google Photos' value was never the gallery; it was the durability.
- Intermittent homelab. A backup target that's offline when your phone wants to sync defeats the purpose. Our test box is a workstation; a real deployment wants always-on — the Oracle free VM's 2 OCPU/12 GB fits Immich better than anything else free.
What we actually ran this on
- Machine: Intel Core Ultra 7 255H (16 cores), 30 GB RAM, NVMe
- OS: Ubuntu 24.04.5 LTS · Docker: 29.8.1, Compose v5.1.3
- Immich: v3 (release tag), official compose: server + ML + VectorChord Postgres + Valkey
- Verified: admin setup, API upload (5 photos), thumbnail + embedding generation, smart search ranking, restart persistence
- Date: 2026-10-30
The DEV TeamPromoted
Join us for a week of all things open weight models, in partnership with Hacktoberfest!
Global Hack Week: Open Source has daily challenges, live streams, and a Discord full of builders. Beginners welcome.
Read More
Google CloudPromoted
Host LLMs in Production With On-Demand GPUs
Top comments (0)
Subscribe

Personal Trusted UserCreate template Templates let you quickly answer FAQs or store snippets for re-use.
Submit PreviewDismiss
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
- [x] Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
Google CloudPromoted
Save Up to 91% on Cloud Compute With Spot VMs
The DEV TeamPromoted
Join us for a week of all things open weight models, in partnership with Hacktoberfest!
Global Hack Week: Open Source has daily challenges, live streams, and a Discord full of builders. Beginners welcome.
Follow
I verify free tiers against official docs and actually deploy what I write about. Building FreeTierWatch — dated, hand-verified data on every dev free tier.
- Joined Oct 6, 2026
More from karthik
Oracle's famous free 4-core/24GB ARM tier is now 2-core/12GB (check the docs) #oracle#cloud#selfhosted#devopsSelf-host Uptime Kuma: a status page in 10 minutes (with real RAM numbers) #selfhosted#docker#devops#tutorial
Google CloudPromoted
$300 Free Credits for Your Google Cloud Projects
The DEV TeamPromoted
Missed Week One? Week Two Starts Monday.
Every Hacktoberfest challenge is its own shot at a cash prize. Jump in whenever you're ready.
👋 Kindness is contagious
Explore this practical breakdown on DEV’s open platform, where developers from every background come together to push boundaries. No matter your experience, your viewpoint enriches the conversation.
Dropping a simple “thank you” or question in the comments goes a long way in supporting authors—your feedback helps ideas evolve.
At DEV, shared discovery drives progress and builds lasting bonds. If this post resonated, a quick nod of appreciation can make all the difference.
Okay
DEV Community — A space to discuss and keep up software development and manage your software career
Built on Forem — the open source software that powers DEV and other inclusive communities.
Made with love and Ruby on Rails. DEV Community © 2016 - 2026.

We're a place where coders share, stay up-to-date and grow their careers.
來源:DEV Community · dev.to




karthik