---
title: "Deploy Piwigo"
description: "Self-hosted photo gallery with albums, tags, sharing and MySQL"
category: "Storage"
url: https://railway.com/deploy/piwigo-1
---

# Deploy Piwigo

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

**[Deploy Piwigo on Railway](https://railway.com/template/piwigo-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/piwigo-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Storage

## Template content

### MySQL https://devicons.railway.app/i/mysql.svg

- **Image:** mysql:8
- **Start command:** `docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=128M`

### Piwigo https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/piwigo.png

- **Source:** https://github.com/aalfath/piwigo-railway-template
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# 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

* 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/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.



## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/piwigo-1
