Piwigo logo

Piwigo

Open source photo gallery software for the web

Alternative to: google photos, flickr, smugmug


Piwigo is open source photo gallery software for the web, designed for organizations, teams, and individuals to manage their photo library. It supports multi-user permission management, albums and tags, and over 200 community plugins and themes, giving it a mature self-hosted alternative feel to Google Photos, Flickr, and SmugMug.

Piwigo Docker Compose example

Self-host Piwigo on your own server, homelab, or VPS starting from this Docker Compose example. It runs Piwigo in Docker containers using the official piwigo/piwigo:latest, mariadb:lts images, with persistent volumes and automatic restarts preconfigured. Review the environment variables and adjust them to your setup, save the file as compose.yml (or docker-compose.yml), and start the stack with docker compose up -d.

services:
  piwigo-main:
    image: piwigo/piwigo:latest
    restart: unless-stopped
    depends_on:
      - piwigo-db
    environment:
      # Container timezone.
      TZ: "UTC"
      # UID the Piwigo files are owned by inside the data volume.
      PIWIGO_UID: "1000"
      # GID the Piwigo files are owned by inside the data volume.
      PIWIGO_GID: "1000"
    volumes:
      - piwigo:/var/www/html/piwigo/
      - scripts:/usr/local/bin/scripts/
  piwigo-db:
    image: mariadb:lts
    restart: unless-stopped
    environment:
      # Generate a random MariaDB root password on first start.
      MARIADB_RANDOM_ROOT_PASSWORD: "true"
      # Database user Piwigo connects as (enter this in the web installer).
      MARIADB_USER: "piwigodb_user"
      # Database name Piwigo uses (enter this in the web installer).
      MARIADB_DATABASE: "piwigodb"
      # Password for the Piwigo database user (enter this in the web installer).
      MARIADB_PASSWORD: "changeme"
      # Container timezone.
      TZ: "UTC"
    volumes:
      - mysql:/var/lib/mysql

volumes:
  piwigo:
  scripts:
  mysql:

Values set to changeme are required — replace them with your own values before starting Piwigo.

Prefer a managed setup? WinterFlow installs, configures, and updates Piwigo for you using this same Docker Compose configuration.