Skip to content

Self-host PiGallery2

updated Sep 2026prices checked · Jul 2026Install verified on Ubuntu 26.04 · Sep 2026 · how we test
We earn commissions when you shop through the links below. Full disclosure →

A directory-first web photo gallery: point it at a folder of photos and videos and it indexes them into a browsable, searchable gallery, reading the originals without modifying them.

Key facts

LicenseMIT
StackTypeScript, Node.js, Angular
Min RAM1024 MB
Official imageyes
Measured idle RAM110 MB
Difficulty

What you need

  • Any VPS with at least 1024 MB of RAM
  • A domain you control — most self-hosted setups need HTTPS in front of them
  • Under an hour if you've used Docker before
Where to host itaffiliate disclosure
Hetzner Cloudrun it on
From $23.59/mo · 2 vCPU / 4 GB / 80 GB · EU + US
Get Hetzner Cloud (opens in new tab)
Kamaterafree trial
From $4/mo · 1 vCPU / 1 GB / 20 GB · US + EU + Asia
Start free on Kamatera → (opens in new tab)
DigitalOceanalso works on
From $6/mo · 1 vCPU / 1 GB / 25 GB · US + EU + Asia
Deploy on DigitalOcean → (opens in new tab)

Paid link — we earn a commission if you shop through it.

Install

Run these commands on your server:

# PiGallery2 — the docs' docker run (Getting Started → Docker), photos mounted read-only
docker run -d --name pigallery2 \
  -p 80:80 -e NODE_ENV=production \
  -v ~/pigallery2/config:/app/data/config \
  -v ~/pigallery2/db:/app/data/db \
  -v ~/Pictures:/app/data/images:ro \
  -v ~/pigallery2/tmp:/app/data/tmp \
  --restart always \
  bpatrik/pigallery2:latest
# open http://SERVER_IP:80 — log in as admin / admin and change that password in Settings first

More in Photo backup & gallery

We use analytics cookies (Google Analytics, PostHog) to see which guides are useful. No ad networks, no cross-site tracking. See our privacy policy.