Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/piwigo-data/
/piwigo-data
/podman-quadlet/piwigo-data
/.env
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

An alpine based container to easily deploy piwigo !

Check the [podman README](./podman-quadlet/README.md) if you would rather use podman.

## Usage

### Starting the container
Expand Down
75 changes: 75 additions & 0 deletions podman-quadlet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Piwigo podman (Quadlet)

## Requirements

- systemd
- podman

## Usage

Create `/etc/containers/systemd/piwigo/` and copy each quadlet units files in it.

```
/etc/containers/systemd/piwigo/
├── piwigo-db.container
├── piwigo.container
└── piwigo.network
```

Reload systemd units and start the service :

```sh
sudo systemctl daemon-reload
sudo systemctl start piwigo.service
```

### Changing the exposed port :

Edit `piwigo.container` :

```diff
- PublishPort=8080:80
+ PublishPort=12345:80
```

### Changing bind-mounts

Bind mounts are links between the host filesystem and the containers.
Systemd placeholder are valid in quadlets, `%h` is match the container user home (`/root/`) see [the documentation](#documentation)

Edit `piwigo.container` :

```diff
- Volume=./piwigo-data/piwigo:/var/www/html/piwigo:z
- Volume=./piwigo-data/scripts:/usr/local/bin/scripts:z
+ Volume=%h/PiwigoPod/piwigo:/var/www/html/piwigo:z
+ Volume=%h/PiwigoPod/scripts:/usr/local/bin/scripts:z
```

And edit `piwigo-db.container` :

```diff
- Volume=./piwigo-data/mysql:/var/lib/mysql:z
+ Volume=%h/PiwigoPod/mysql:/var/lib/mysql:z
```

### Updating

Stop and restart your containers, podman should pull an updated image automatically.

```sh
sudo systemctl stop piwigo.service piwigo-db.service
sudo systemctl daemon-reload
sudo systemctl start piwigo.service
```

### Diagnosing errors

Access the systemd journal `sudo journalctl -eu piwigo.service`, most common errors are permision issues.
Ensure that your volume is in a valid location and has read and write permisions.

### Documentation

- [Quadlet unit documentation](https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html)
- [Volume documentation](https://docs.podman.io/en/v4.4/markdown/options/volume.html)
- [System unit placeholder table](https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#Specifiers)
12 changes: 12 additions & 0 deletions podman-quadlet/piwigo-db.container
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Piwigo database container
[Container]
Environment=MARIADB_RANDOM_ROOT_PASSWORD=true MARIADB_USER=piwigodb_user MARIADB_DATABASE=piwigodb MARIADB_PASSWORD=PASSWORD
Image=docker.io/library/mariadb:lts
Network=piwigo.network
Volume=./piwigo-data/mysql:/var/lib/mysql:z

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pod=piwigo.pod
HealthCmd=healthcheck.sh --connect --innodb_initialized
HealthInterval=30s
HealthRetries=2
HealthTimeout=10s
HealthOnFailure=kill
# Uncomment for automatic updates
#AutoUpdate=registry

[Service]
Restart=always

[Install]
WantedBy=multi-user.target
14 changes: 14 additions & 0 deletions podman-quadlet/piwigo.container
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Piwigo NGINX PHP-FPM container
[Unit]
Requires=piwigo-db.service
After=piwigo-db.service

[Container]
Image=ghcr.io/piwigo/piwigo:latest
Network=piwigo.network
PublishPort=8080:80
Volume=./piwigo-data/piwigo:/var/www/html/piwigo:z
Volume=./piwigo-data/scripts:/usr/local/bin/scripts:z
Copy link
Copy Markdown

@l-2-j l-2-j Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Volume=./piwigo-data/scripts:/usr/local/bin/scripts:z
# Remove `127.0.0.1:` if you want piwigo publicly exposed on all interfaces,
# and/or change `8080` to the host port you want to use.
PublishPort=127.0.0.1:8080:80
Volume=./piwigo-data/piwigo:/var/www/html/piwigo:z
Volume=./piwigo-data/scripts:/usr/local/bin/scripts:z
# Set the timezone and run as unprivileged user
Environment=TZ=... PUID=1000 PGID=1000
Pod=piwigo.pod
HealthCmd=wget -nv --tries=1 --spider http://127.0.0.1/ws.php?method=pwg.session.getStatus || exit 1
HealthInterval=30s
HealthRetries=2
HealthTimeout=10s
HealthOnFailure=kill
# Uncomment for automatic updates
#AutoUpdate=registry


[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions podman-quadlet/piwigo.network
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Piwigo Network
[Network]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Network]
[Network]
Description=Piwigo network
After=podman-user-wait-network-online.service