
Deploy LibrePhotos
Self-hosted Google Photos alternative with face recognition and search
librephotos-unified
Just deployed
/librephotos
Just deployed
/var/lib/postgresql/data
Deploy and Host LibrePhotos on Railway
LibrePhotos is an open-source, self-hosted photo management service and an alternative to Google Photos. It organizes your photos and videos into a timeline, detects and groups faces, tags scenes, generates captions and lets you search your library by content, place and date, all on your own server.
About Hosting LibrePhotos
LibrePhotos normally runs as several containers: a backend, a separate frontend and an nginx proxy that share the same photo and media folders. Railway volumes cannot be shared between services, so this template uses the official single-container image, where Django serves both the API and the web app. All data lives on one volume: photos, thumbnails, machine learning models, logs and caches are placed under it through environment variables. Metadata is stored in Railway Postgres. Machine learning features such as face recognition and captioning need several gigabytes of memory, so plan resources accordingly.
Common Use Cases
- Keeping a private photo and video library as an alternative to Google Photos or iCloud
- Finding people across your photos with automatic face detection and grouping
- Searching a large collection by what is in the picture, where it was taken or when
Dependencies for LibrePhotos Hosting
- The official
reallibrephotos/librephotos-unifiedDocker image (pinned to 1.4.0) - Railway Postgres for the application database
- A Railway volume mounted at
/librephotosfor photos, thumbnails, models and logs
Implementation Details
The template runs the unified image with a single volume. Environment variables move every folder the app uses onto that volume:
| Folder | Contents |
|---|---|
/librephotos/data | Your photos and videos |
/librephotos/protected_media | Thumbnails and machine learning models |
/librephotos/logs | Log files |
/librephotos/cache | Downloaded model caches |
The start command creates the photo folder before the app starts, since a fresh volume is empty:
sh -c "mkdir -p /librephotos/data && exec /entrypoint.sh"
Logging in: Use admin as the username and the value of ADMIN_PASSWORD from the Variables tab as the password. LibrePhotos resets the admin password to this value on every start. To change it, update the variable rather than changing it in the app.
Adding photos: There is no host folder to scan, so photos are uploaded from the browser. After your first login, set your scan directory to /librephotos/data in your user settings, then upload photos.
Resource usage: WORKER_CONCURRENCY is set to 2. If left empty, LibrePhotos starts one background worker per CPU core, which uses a lot of memory on Railway. To lower memory further, you can turn off individual features, for example FEATURE_IMAGE_CAPTIONING="false" or FEATURE_SCENE_CLASSIFICATION="false".
Face grouping with few photos: Grouping faces into people needs a minimum number of detected faces. With only a handful of photos you may see Face clustering job failed in the logs. This is expected and resolves once more photos with faces are added.
First start: The first start runs all database migrations and can take a few minutes. The app shows a "starting" page until it is ready.
Why Deploy LibrePhotos on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying LibrePhotos on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
librephotos-unified
reallibrephotos/librephotos-unified:1.4.0ADMIN_EMAIL
Optional admin email
