Immich: Self-Hosted Google Photos Alternative
Google Photos changed behavior in 2021 — ending unlimited free storage and enforcing quotas. For people with large photo libraries, the alternatives are paying Google or finding something else. Immich is the most capable self-hosted replacement: mobile backup apps, face recognition, album sharing, timeline view, and map view. It's a full-featured photo management system.
Photo by Steve Johnson on Unsplash
What Immich Provides
- Mobile backup: iOS and Android apps with automatic backup on Wi-Fi
- Timeline view: Photos organized by date, scrollable over years
- Albums: Manual albums and smart albums (by location, date, people)
- Face recognition: Group photos by detected faces
- Map view: See photos plotted on a world map based on GPS metadata
- Video support: Transcodes videos for web playback
- Sharing: Share albums with other users or via public links
- Search: Search by content (AI-powered), location, date, or metadata
- HEIC/RAW support: iPhone HEIC and camera RAW files with conversion
Docker Compose Deployment
Immich requires several services: the server, microservices worker (for ML tasks), Redis, PostgreSQL, and a machine learning container:
# docker-compose.yml
name: immich
services:
immich-server:
image: ghcr.io/immich-app/immich-server:release
restart: always
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- 2283:2283
depends_on:
- redis
- database
healthcheck:
disable: false
immich-machine-learning:
image: ghcr.io/immich-app/immich-machine-learning:release
volumes:
- model-cache:/cache
restart: always
redis:
image: redis:6.2-alpine
restart: always
database:
image: tensorchord/pgvecto-rs:pg14-v0.2.0
restart: always
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata:
model-cache:
Create a .env file:
# Immich configuration
UPLOAD_LOCATION=/path/to/your/photo/storage
DB_PASSWORD=change-this-password
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
# No quotes around values in .env
Start:
docker compose up -d
Navigate to http://your-server:2283 for initial setup.
Note: Immich uses tensorchord/pgvecto-rs (PostgreSQL with vector extension) instead of standard PostgreSQL. This is required — don't swap it for a regular Postgres image.
Initial Setup
- Open
http://your-server:2283 - Create the admin account
- Configure server settings (Administration → Settings):
- Storage template: customize how files are organized on disk
- Machine learning model: choose face recognition model (faster vs more accurate)
- SMTP for email notifications
Like what you're reading? Subscribe to Self-Hosted Weekly — free weekly guides in your inbox.
Mobile App Setup
Install the Immich app on iOS or Android.
- Open app → Enter your server URL:
http://your-server:2283(orhttps://if you've set up a reverse proxy) - Log in with your credentials
- Grant photo library permissions
- Configure backup: Settings → Backup → Auto backup when charging and on Wi-Fi
The mobile app backs up original quality files. Backup runs in the background and shows progress.
Tip: Set up a reverse proxy (Nginx Proxy Manager or Caddy) with HTTPS so the mobile app works over cellular when you're away from home. Use a real domain or subdomain pointing to your server.
Reverse Proxy Setup (Caddy example)
photos.yourdomain.com {
reverse_proxy localhost:2283
tls [email protected]
}
With HTTPS, the mobile app can back up photos when you're not on your home Wi-Fi.
Face Recognition
Immich performs face detection and clustering automatically as photos are processed. After faces are detected:
- Explore → People — see detected face clusters
- Assign names to faces
- Search by person name: "Photos of Alice"
The ML container handles this. It downloads the face recognition model on first use (~500MB). Processing is CPU-bound; a faster CPU processes faces faster.
Import Existing Photo Library
If you have existing photos (local drive, Google Photos export, iCloud export):
From local directory: Mount the directory as an external library:
- Administration → External Libraries → Add Library
- Point to the directory containing photos
- Immich reads and indexes them without moving files
From Google Photos takeout:
# Google Takeout exports a zip; extract it first
# Use immich-go tool for bulk import
go install github.com/simulot/immich-go@latest
immich-go -server http://your-server:2283 -key YOUR_API_KEY \
upload --google-photos /path/to/takeout
The immich-go tool handles Google Takeout's metadata structure and imports photos with correct dates.
Storage Template
Customize how Immich organizes uploaded files on disk (Administration → Settings → Storage Template):
Default: {{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}
Results in: 2024/2024-06-15/IMG_5432.JPG
You can customize with any combination of date, time, and metadata variables.
Backup Immich
Back up two things:
- PostgreSQL database: Contains all metadata, albums, faces, users
- Upload location: The actual photo files
# Database backup
docker exec -t immich_database_1 pg_dumpall -c -U postgres > immich_backup_$(date +%Y%m%d).sql
# Photo storage: already on your disk, include in regular backup strategy
# rsync, restic, rclone, etc.
Hardware Requirements
| Use case | RAM | CPU |
|---|---|---|
| Small library (<20K photos) | 4GB | 2 cores |
| Medium library (20-100K) | 8GB | 4 cores |
| Large library (100K+) | 16GB+ | 6+ cores |
Machine learning (face recognition, CLIP search) is CPU-intensive. A NAS with a low-power processor will process ML tasks slowly but correctly — it's asynchronous, so it doesn't affect the user experience.
GPU acceleration for ML: Immich supports CUDA (NVIDIA) and OpenVINO (Intel) for accelerated inference. Optional but dramatically faster for large libraries.
Privacy Considerations
Photos stay on your server. No data is sent to third-party services:
- Face recognition runs locally
- AI search (CLIP) runs locally via the machine learning container
- The map feature uses a configurable tile server (default is OpenStreetMap-compatible)
This is the point of self-hosting: your family photos don't train someone else's models.
The repository is immich-app/immich. It's under active development with frequent releases. Check the GitHub releases page before updating — Immich occasionally has breaking database migrations that require following the upgrade process.
