Deploy PhotoView
Self-hosted photo gallery: albums, faces, sharing, WebDAV photo uploads
PhotoView
Just deployed
/data
Just deployed
/var/lib/postgresql/data
Deploy and Host PhotoView on Railway
PhotoView is an open-source, self-hosted photo gallery. It reads the photos and videos in a folder, keeps the folder structure as albums, makes thumbnails, shows EXIF data, plays videos and can group faces. You can share albums or single photos by link and give other users their own libraries.
About Hosting PhotoView
PhotoView needs a database, a folder of photos and a cache folder for thumbnails and transcoded videos, and both folders must persist. This template runs PhotoView 2.4.0 from the official image with Railway Postgres and one volume at /data (photos in /data/photos, cache in /data/cache). The start script finishes PhotoView's setup itself before the public port opens, so the setup page is never exposed: you sign in as admin with the generated ADMIN_PASSWORD from the service's Variables tab. PhotoView has no upload button, so the template also serves the photo folder over WebDAV at /webdav, protected by the same login. New photos are picked up by an automatic scan every 15 minutes.
Common Use Cases
- A private photo library you can browse from any browser or phone
- Sharing albums with family and friends through public or password-protected links
- Browsing a large archive of photos, RAW files and videos by folder, date or face
Dependencies for PhotoView Hosting
- Railway Postgres (deployed with the template)
- A volume for photos and the thumbnail cache (deployed with the template)
Deployment Dependencies
- PhotoView on GitHub: https://github.com/photoview/photoview
- PhotoView 2.4.0 release: https://github.com/photoview/photoview/releases/tag/v2.4.0
- PhotoView documentation: https://photoview.github.io/en/docs/
- Template source and changelog: https://github.com/aalfath/photoview-railway-template
Implementation Details
Sign in: open the service's public URL and sign in as admin (or your ADMIN_USERNAME) with the ADMIN_PASSWORD value from the Variables tab. These set up PhotoView once; change the password later in PhotoView's Settings. WebDAV always uses the current variable values.
Add photos over WebDAV at https://YOUR-DOMAIN/webdav/:
- macOS Finder: Go, Connect to Server, then enter the address
- Windows: Map network drive, then enter the address
- rclone:
rclone copy ./Pictures :webdav,url=https://YOUR-DOMAIN/webdav,user=admin,pass=OBSCURED-PASSWORD: -P(makeOBSCURED-PASSWORDwithrclone obscure)
Then wait for the next scan, or press Scan under Settings.
Optional variables: MAPBOX_TOKEN turns on the map view (a free token from mapbox.com). PHOTOVIEW_DISABLE_FACE_RECOGNITION=1, PHOTOVIEW_DISABLE_VIDEO_ENCODING=1 and PHOTOVIEW_DISABLE_RAW_PROCESSING=1 save CPU. PERIODIC_SCAN_SECONDS sets the first automatic scan interval (default 900).
Size the volume for your library: the thumbnail cache adds roughly 10 to 20 percent on top of the photos.
Why Deploy PhotoView 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 PhotoView 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
