Running Immich on 4GB RAM means accepting a reduced feature set.
Immich lists 6GB RAM as the minimum and 8GB as recommended. Its requirements page makes one narrow exception: a 4GB system can run with machine-learning features disabled. This guide turns that exception into a reversible operating plan.
What you give up
| Change | Likely effect | What remains |
|---|---|---|
| Disable Smart Search | No contextual CLIP search; duplicate detection that uses CLIP is also unavailable. | Filename, path, metadata and other non-ML search filters. |
| Disable Facial Recognition | No new face detection or people clustering. | Core photo storage, albums and sharing. |
| Keep ML but use a smaller face model | Lower memory demand, with a possible quality tradeoff. | Facial recognition remains available. |
| Move ML to another host | Preview images cross the private network; another service must be secured and updated. | Smart Search and face features can remain enabled. |
Safe reduction sequence
- Record a baseline. Save the current Immich version and copy the current configuration from Administration → Settings. Check free memory and the Administration → Jobs page before changing anything.
- Disable by feature in the admin UI. Under Administration → Settings → Machine Learning Settings, disable Smart Search and Facial Recognition. Immich's FAQ says disabling jobs does not stop the ML service itself; feature disabling is about workload, not container removal.
- Reduce concurrency. Immich recommends lowering Smart Search, Face Detection and video-transcoding job concurrency to 1 on constrained systems. Set transcoding threads to 1 or 2 if video work is also causing pressure.
- Restart during a quiet window. Restart the stack using the same supported Docker Compose deployment method you already use. Do not delete the database, upload library, generated media or model cache as part of this change.
- Verify core workflows. Upload one photo and one representative video. Confirm thumbnail generation, timeline viewing, original download, video playback and the scheduled database dump. Watch memory and failed jobs during the test.
- Choose the durable path. If the host stays stable and the missing features are acceptable, document the reduced mode. Otherwise upgrade to at least the official minimum or use remote ML on a trusted machine.
Do not “optimize” the database below its needs
Immich says Postgres needs at least 2GB RAM when Docker resource limits are used, and its data should be on local SSD storage rather than a network share. On a 4GB host, tight container limits can simply move the failure from ML to the database. Treat database stability and backups as non-negotiable.
Recovery checklist
- No out-of-memory restarts appear during a representative upload.
- The Jobs page drains rather than accumulating failed thumbnail or video jobs.
- The latest database dump completes and is copied off the host.
- Original assets remain independently backed up; disabling ML is not a backup measure.
- The reduced feature set is documented for other users.
- A rollback note records the previous ML settings and when to re-enable them.
When remote ML is better
If Smart Search or faces matter, use the remote machine-learning guide. Prefer adding the remote URL while retaining local fallback only when the 4GB host can safely absorb fallback work; otherwise force remote processing and accept that ML jobs fail while the remote host is offline. Never expose the ML service directly to the public internet.
用 4GB 内存运行 Immich,意味着接受功能精简。
Immich 官方把 6GB 列为最低内存、8GB 列为建议内存。要求页面只给出一个有限例外:关闭机器学习功能后,4GB 系统可以运行。本指南把这个例外变成可回退的操作方案。
会失去什么
| 变更 | 影响 | 仍然保留 |
|---|---|---|
| 关闭智能搜索 | 无法使用 CLIP 语义搜索;依赖 CLIP 的重复检测也不可用。 | 文件名、路径、元数据等非 ML 搜索过滤。 |
| 关闭人脸识别 | 不再进行新人脸检测和人物聚类。 | 照片存储、相册和共享等核心功能。 |
| 保留 ML,但使用较小人脸模型 | 降低内存需求,但可能牺牲识别质量。 | 继续使用人脸识别。 |
| 把 ML 移到另一台主机 | 预览图会经过私有网络,还要保护和更新额外服务。 | 可保留智能搜索和人脸功能。 |
安全精简顺序
- 记录基线。保存当前 Immich 版本,并从“管理 → 设置”复制当前配置。变更前检查可用内存和“管理 → 任务”页面。
- 在管理界面按功能关闭。进入“管理 → 设置 → 机器学习设置”,关闭智能搜索和人脸识别。Immich FAQ 说明:关闭所有任务并不会自动停止 ML 服务;这里首先减少的是工作负载。
- 降低并发。Immich 建议受限系统把智能搜索、人脸检测和视频转码任务并发降到 1。若视频处理也造成压力,把转码线程设为 1 或 2。
- 在低峰期重启。沿用现有、受支持的 Docker Compose 部署方式重启。不要在本次变更中删除数据库、上传目录、生成媒体或模型缓存。
- 验证核心流程。上传一张照片和一个有代表性的视频,确认缩略图、时间线、原图下载、视频播放和计划数据库转储正常,并观察内存和失败任务。
- 选择长期方案。如果系统稳定且可以接受缺失功能,记录精简模式;否则升级到官方最低配置,或在可信机器上运行远程 ML。
不要把数据库“优化”到无法稳定运行
Immich 说明:使用 Docker 资源限制时,Postgres 至少需要 2GB 内存;数据库数据应放在本地 SSD,而不是网络共享。4GB 主机上的过紧限制,可能只是把故障从 ML 转移到数据库。数据库稳定性和备份不能妥协。
恢复检查表
- 代表性上传期间没有内存不足重启。
- 任务队列能够清空,而不是累积缩略图或视频失败任务。
- 最新数据库转储成功,并复制到主机之外。
- 原始资产有独立备份;关闭 ML 不是备份措施。
- 为其他用户记录精简后的功能范围。
- 回退记录包含原 ML 设置和重新启用条件。
何时应改用远程 ML
如果智能搜索或人脸功能很重要,请使用远程机器学习指南。只有当 4GB 主机能够安全承受回退负载时,才保留本地回退;否则强制远程处理,并接受远程主机离线时 ML 任务失败。不要把 ML 服务直接暴露到公网。