---
title: "Deploy Immich | Open Source Google Photos Alternative"
description: "Self-host Immich. Facial recognition, mobile backup, smart search & more"
category: "Storage"
url: https://railway.com/deploy/immich-gphotos-alternative
---

# Deploy Immich | Open Source Google Photos Alternative

Self-host Immich. Facial recognition, mobile backup, smart search & more

**[Deploy Immich | Open Source Google Photos Alternative on Railway](https://railway.com/template/immich-gphotos-alternative)**

- **Creator:** Heimdall
- **Category:** Storage
- **Total deploys:** 7

## Template content

### Postgres https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgres.svg

- **Image:** ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0

### Redis https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/redis.svg

- **Image:** valkey/valkey:9

### Immich-ML https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/immich.svg

- **Image:** ghcr.io/immich-app/immich-machine-learning:release

### Immich-Server https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/immich.svg

- **Image:** ghcr.io/immich-app/immich-server:release
- **Public domain:** Yes

## Documentation

![Immich logo](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT7puTG_BvfwN8yS9uBCIT39XFPkML2ahWk3A&s)

# 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.

![Immich Railway architecture](https://res.cloudinary.com/asset-cloudinary/image/upload/v1776530008/immich-railwa-arch_rhrpdb.png)

## 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](https://apps.apple.com/app/immich/id1613945686) / [Android](https://play.google.com/store/apps/details?id=app.alextran.immich)) 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.

![Immich dashboard screenshot](https://res.cloudinary.com/asset-cloudinary/image/upload/v1776530008/immich-dashboard_mvtpqz.png)

## 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-go` CLI 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](https://github.com/immich-app/immich) (98k+ stars, AGPL-3.0)
- **Docker Hub:** [ghcr.io/immich-app](https://github.com/orgs/immich-app/packages)
- **Docs:** [docs.immich.app](https://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
```

```bash
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](https://github.com/simulot/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.


## Similar templates

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

Open this page in a browser: https://railway.com/deploy/immich-gphotos-alternative
