Deploy Piwigo

Self-hosted photo gallery with albums, tags, sharing and MySQL

Deploy Piwigo

MySQL

mysql:8

Just deployed

/var/lib/mysql

/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/piwigo image: nginx, PHP 8.4, ImageMagick, ffmpeg)
  • MySQL (Railway's MySQL service) for albums, users, tags and settings

Deployment Dependencies

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/piwigo for the app files, uploaded photos, thumbnails, plugins and themes.
  • MySQL: the gallery database on the private network, volume /var/lib/mysql.

After deploying:

  1. Open the Piwigo service's public URL and log in as admin.
  2. The password is PIWIGO_ADMIN_PASSWORD on the Piwigo service's Variables tab. It is only used for the first install, so change it later in Piwigo, not in the variable.
  3. In Admin, Users, set your own email address on the admin account (it starts as admin@example.com).
  4. 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

More templates in this category

View Template
RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set
S3-compatible object store, keys and public URL preset, volume kept

SuperSlowSloth
0
View Template
TimescaleDB
A PostgreSQL-based time-series database for analytics on Railway.

Rakit
1
View Template
Neo4j 2026.10 Community
Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

My Projects
0