# Self-host PiGallery2

> A directory-first photo gallery that shows your folders as they are on disk, with search, maps and thumbnails. Photos are read from a volume, so you copy them in or mount a folder.

- Page: https://levelrail.com/templates/pigallery2/
- JSON: https://levelrail.com/templates/pigallery2.json
- Category: Media
- Licence: MIT (Permissive license)
- Source: https://github.com/bpatrik/pigallery2
- Upstream docs: https://bpatrik.github.io/pigallery2/

## Requirements
- Memory: about 512 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 3.5.2-alpine

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| pigallery2 | bpatrik/pigallery2 | 3.5.2-alpine | 80 | config -> /app/data/config; db -> /app/data/db; images -> /app/data/images; tmp -> /app/data/tmp |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| pigallery2 | NODE_ENV | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy pigallery2 --name my-pigallery2
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/pigallery2/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## First run
1. Open the address, create the admin account, then add photos to the images volume and rescan from the settings.

## Questions

### Can I deploy PiGallery2 on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for PiGallery2, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image bpatrik/pigallery2:3.5.2-alpine is what you deploy there.

Self-host PiGallery2, PiGallery2 docker compose file, deploy PiGallery2 on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
