Linux

Where Does PiGallery2 Store Config and Photos?

PiGallery2 mounts config, db, images, and tmp under app data config. Never change image paths in UI, only volumes.

Last updated

PiGallery2 maps four host folders into fixed container paths: config, db, images, and tmp. The config.json file sets users, shares, and jobs while pointing at those fixed inside paths. Photos stay read only in place.

The database file holds users even in memory mode, so its volume matters. Thumbnails cache into tmp. User roles and share links resolve against the database on every request. Upgrades are image swaps with the same mounts, and the docs insist path changes happen only in volume settings. Sharing links resolve against the same database.

Where PiGallery2 stores this, by platform

Linux
/opt/pigallery2/config/config.json

Main config with users, shares, and jobs. Edit by hand or the settings UI. Keep image and tmp paths at container defaults.

Linux
/opt/pigallery2/db/pigallery2.db

User accounts and metadata database. Mount always, even in memory mode, or logins vanish on restart.

Linux
/opt/pigallery2/images

Read only photo tree plus thumbnail cache. Point volumes here from the host library. Never let the app write into images.

Frequently asked questions

How do I back up PiGallery2?

Back up the four mounted host folders together: config, db, images, tmp. Users live in the db even with memory mode, so skipping it locks you out.

How do I move my photo folder?

Change only the Docker volume mappings, never the paths in config.json or UI. The docs warn that UI path edits break the install.

Notice an outdated path? Let us know.