Deploy Immich | Open Source Google Photos Alternative
Self-host Immich. Facial recognition, mobile backup, smart search & more
DBs
Just deployed
/var/lib/postgresql/data
Redis
Just deployed
Just deployed
/cache
Immich-Server
Just deployed
/data
Deploy and Host Immich on Railway
Deploy Immich on Railway to run a self-hosted Google Photos alternative with full privacy control. Immich is an open-source photo and video management platform with automatic mobile backup, facial recognition, smart search, and a polished web interface that rivals commercial cloud services.
This Railway template pre-configures four services: Immich-Server (API + web UI + background workers), Immich-ML (machine learning for facial recognition and smart search), PostgreSQL with pgvector/VectorChord extensions for vector embeddings, and Valkey (Redis-compatible cache). All services communicate over Railway's private network with volumes attached for persistent media and database storage.

Getting Started with Immich on Railway
After deployment completes, open the Immich-Server public URL in your browser. You'll see Immich's first-time setup wizard — create your admin account with an email and password. Once logged in, navigate to the Administration panel to configure storage, user accounts, and machine learning settings. Download the official Immich mobile app (iOS / Android) and connect it to your Railway URL to start backing up photos automatically. Your first upload will trigger ML processing for facial recognition and smart search indexing.

About Hosting Immich
Immich is a high-performance, self-hosted photo and video management solution built with Node.js (server) and Python (machine learning). It provides a complete replacement for Google Photos with full data ownership.
- Automatic mobile backup with background sync on iOS and Android
- AI-powered features — facial recognition, object detection, CLIP-based smart search, OCR
- Timeline and map views with reverse geocoding
- Multi-user support with sharing, albums, and granular permissions
- External library scanning for existing photo collections
- REST API with OpenAPI specs for automation and integrations
- Memory feature — resurface photos from past dates
The architecture separates the API/web server from the ML pipeline, allowing independent scaling. PostgreSQL stores metadata and vector embeddings for similarity search; Valkey handles caching and job queues.
Why Deploy Immich on Railway
Railway makes self-hosting Immich simple with zero infrastructure management:
- One-click deployment of all four services with private networking pre-configured
- Persistent volumes for media storage and database with automatic backups
- Auto-generated HTTPS domain — no certificate management
- Scale ML workers independently from the web server
- No Docker or server administration required
Common Use Cases for Self-Hosted Immich
- Family photo hub — centralize photos from multiple family members' phones with multi-user accounts and shared albums
- Google Photos migration — import your Google Takeout archive using
immich-goCLI tool and maintain the same automatic backup workflow - Photography workflow — organize large RAW and HEIC collections with metadata search, facial recognition, and location-based browsing
- Privacy-first backup — keep sensitive photos on infrastructure you control instead of third-party cloud storage
Dependencies for Self-Hosted Immich on Railway
This template deploys four services:
- Immich-Server —
ghcr.io/immich-app/immich-server:release— API server, web UI, and background microservices - Immich-ML —
ghcr.io/immich-app/immich-machine-learning:release— machine learning inference (facial recognition, CLIP, OCR) - PostgreSQL —
ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0— database with pgvector and VectorChord extensions for vector similarity search - Valkey —
valkey/valkey:9— Redis-compatible in-memory cache for job queues and sessions
Environment Variables Reference for Immich on Railway
| Variable | Service | Description |
|---|---|---|
PORT | Immich-Server | HTTP listening port (2283) |
DB_HOSTNAME | Immich-Server | PostgreSQL host via private network |
DB_PASSWORD | Immich-Server | Database password (references Postgres service) |
DB_DATABASE_NAME | Immich-Server | Database name |
REDIS_HOSTNAME | Immich-Server | Valkey/Redis host via private network |
IMMICH_MACHINE_LEARNING_URL | Immich-Server | ML service endpoint on private network |
IMMICH_LOG_LEVEL | Immich-Server | Log verbosity (log, debug, verbose, warn, error) |
POSTGRES_PASSWORD | Postgres | Database superuser password |
POSTGRES_DB | Postgres | Default database name |
PGDATA | Postgres | Data directory (must be volume subdirectory) |
Deployment Dependencies
- Runtime: Node.js (server), Python (ML), PostgreSQL 14+
- GitHub: immich-app/immich (98k+ stars, AGPL-3.0)
- Docker Hub: ghcr.io/immich-app
- Docs: docs.immich.app
Hardware Requirements for Self-Hosting Immich
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 2 cores | 4+ cores |
| RAM | 4 GB (ML disabled) | 6–8 GB |
| Storage | Depends on library size | SSD required for database |
| Runtime | Docker 20+ | Docker Compose v2+ |
The ML service uses ~2–4 GB RAM for model inference. For large libraries (100k+ photos), allocate additional CPU for background processing. On Railway, the default container resources are sufficient for personal use; scale up for multi-user or large libraries.
Self-Hosting Immich with Docker Compose
The quickest way to self-host Immich outside Railway:
mkdir immich && cd immich
curl -Lo docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
curl -Lo .env https://github.com/immich-app/immich/releases/latest/download/example.env
Edit .env to set a strong DB_PASSWORD and your upload location:
UPLOAD_LOCATION=/path/to/your/photos
DB_PASSWORD=your-secure-password-here
DB_DATA_LOCATION=/path/to/postgres/data
compose up -d
Access Immich at http://localhost:2283 and create your admin account.
Is Immich Free to Self-Host?
Immich is 100% free and open-source under the AGPL-3.0 license. All features — facial recognition, smart search, mobile backup, multi-user support — are available without payment. Optional product keys ($25 individual / $100 server lifetime) exist purely to support development and unlock zero additional functionality. When deployed on Railway, your only cost is Railway infrastructure usage.
Immich vs PhotoPrism vs Google Photos
| Feature | Immich | PhotoPrism | Google Photos |
|---|---|---|---|
| Self-hosted | Yes | Yes | No |
| Mobile app | Official iOS + Android | Third-party only | Official |
| Auto backup | Yes (background sync) | No | Yes |
| Facial recognition | Yes (on-device ML) | Yes | Yes (cloud) |
| Smart search (CLIP) | Yes | No | Yes (cloud) |
| Multi-user | Yes | Limited | Yes |
| Open source | AGPL-3.0 | AGPL-3.0 | Proprietary |
| Price | Free | Free + paid tiers | Free (15GB) + paid |
Immich is the strongest self-hosted Google Photos alternative due to its mobile app parity, active development pace, and comprehensive AI features running entirely on your hardware.
FAQ
What is Immich and why should I self-host it? Immich is an open-source photo and video management platform that replaces Google Photos. Self-hosting gives you full ownership of your media, no storage limits, no subscription fees, and complete privacy — your photos never leave your server.
What does this Railway template deploy for Immich? This template deploys four interconnected services: Immich-Server (web UI and API), Immich-ML (machine learning for facial recognition and smart search), PostgreSQL with vector extensions (metadata and embeddings), and Valkey (Redis-compatible cache for job queues).
Why does Immich need a custom PostgreSQL image instead of standard Postgres?
Immich uses pgvector and VectorChord extensions for vector similarity search — this powers facial recognition matching and CLIP-based smart search. The custom image (ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0) ships with these extensions pre-installed. Standard Railway-managed Postgres does not include them.
Can I disable the machine learning service to save resources on Railway? Yes. Remove or stop the Immich-ML service. Immich will continue working for uploads, browsing, and sharing — you'll just lose facial recognition, smart search, and object detection. This reduces RAM usage by 2–4 GB.
How do I import my Google Photos library into self-hosted Immich? Use the community tool immich-go to import a Google Takeout archive directly into Immich. It preserves album structure, metadata, and timestamps. Run it from your local machine pointing at your Railway Immich URL.
How much storage does Immich need on Railway? Storage depends entirely on your photo/video library size. A typical phone backup of 50,000 photos uses 100–200 GB. Railway volumes support up to 1 TB on the Pro plan. Videos consume significantly more space than photos.
Template Content