Self-host PiGallery2
updated Sep 2026deployed by usprices 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
CategoryPhoto backup & gallery
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 + USKamaterafree trial
From $4/mo · 1 vCPU / 1 GB / 20 GB · US + EU + AsiaDigitalOceanalso works on
From $6/mo · 1 vCPU / 1 GB / 25 GB · US + EU + AsiaPaid 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 firstMore in Photo backup & gallery
Photo backup & gallery
Ente
GoPostgreSQL
moderateRead guide →
Photo backup & gallery
Immich
TypeScriptNode.js
moderateRead guide →
Photo backup & gallery
Lychee
PHPLaravelVue
easyRead guide →
Photo backup & gallery
PhotoPrism
GoJavaScript
easyRead guide →