Deploy Piwigo
Self-hosted photo gallery with albums, tags, sharing and MySQL
MySQL
Just deployed
/var/lib/mysql
Just deployed
/var/www/html/piwigo
Deploy and Host Piwigo on Railway
Piwigo is open-source photo gallery software for the web, developed since 2002. You upload photos, organise them into albums, tags and dates, and share them publicly or only with chosen users and groups. It handles large collections, generates thumbnails and resized copies automatically, and can be extended with themes and plugins.
About Hosting Piwigo
Hosting Piwigo means running a PHP web app (nginx and php-fpm) next to a MySQL database, keeping the uploaded photos and generated thumbnails on persistent storage, and getting through the install wizard before anyone else reaches it. This template does that for you: Piwigo builds from the official piwigo/piwigo image pinned by version and digest, Railway's MySQL stores the gallery data, and both have their own volume. On the first boot the wrapper waits for MySQL and installs Piwigo without the web wizard, creating the webmaster account admin with a generated password. A /healthz check confirms the app and database answer before traffic arrives.
Common Use Cases
- Share family or event photos privately with relatives and friends through user and group permissions
- Publish a photographer's or club's public portfolio organised by albums and tags
- Keep a self-hosted archive of a large photo collection instead of a commercial cloud service
Dependencies for Piwigo Hosting
- Piwigo 16.5.0 (official
piwigo/piwigoimage: nginx, PHP 8.4, ImageMagick, ffmpeg) - MySQL (Railway's MySQL service) for albums, users, tags and settings
Deployment Dependencies
- Piwigo: https://piwigo.org
- Piwigo source code: https://github.com/Piwigo/Piwigo
- Official Docker image: https://github.com/Piwigo/piwigo-docker
- Release notes: https://piwigo.org/release-16.5.0
- Template repository: https://github.com/aalfath/piwigo-railway-template
Implementation Details
Services in this template:
- Piwigo: the web gallery, built from https://github.com/aalfath/piwigo-railway-template. Public domain, port 8080, health check
/healthz, volume/var/www/html/piwigofor the app files, uploaded photos, thumbnails, plugins and themes. - MySQL: the gallery database on the private network, volume
/var/lib/mysql.
After deploying:
- Open the Piwigo service's public URL and log in as
admin. - The password is
PIWIGO_ADMIN_PASSWORDon the Piwigo service's Variables tab. It is only used for the first install, so change it later in Piwigo, not in the variable. - In Admin, Users, set your own email address on the admin account (it starts as
admin@example.com). - Create an album and upload photos (Admin, Photos, Add). Photos up to 100 MB are accepted.
Optional: add SMTP settings under Admin, Configuration, Options, Email for password-reset and notification emails.
It runs on Railway's smallest plans (0.5 GB RAM per service): thumbnails are generated one at a time to stay inside that limit. If setup fails, the container exits with an error so Railway restarts it.
Updates: new Piwigo versions are released as commits to the template repository, and Railway shows you an "update available" notice. Applying it copies the new Piwigo files onto the volume and keeps your photos and settings; after a major version Piwigo opens its upgrade page, where the webmaster logs in to finish the database upgrade. Read CHANGELOG.md in the repository before you apply an update, and back up the volume and database before major versions.
Why Deploy Piwigo 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 Piwigo 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
MySQL
mysql:8