Piwigo

Open-source self-hosted photo gallery for managing and sharing large image libraries with full privacy control and 200+ plugins.

3.8Kstars
479forks
GNU GPLv2
PHP

Piwigo is an open-source photo gallery application that enables individuals, teams, and organizations to manage, organize, and share large photo libraries on the web with full control over their data and privacy. It runs on your own server using a standard LAMP stack — PHP, MySQL or MariaDB, and Apache or nginx — so your images never leave your infrastructure.

The application handles collections of any scale, from a few thousand vacation photos to professional archives exceeding a hundred thousand images. Hierarchical albums, tag-based organization, EXIF metadata browsing, and a powerful batch manager let you categorize and act on large sets of images in one operation. Granular permission controls allow you to restrict specific albums or individual photos to specific user groups, making it equally useful for public photo blogs and internal team sharing.

Piwigo’s extensibility is a defining characteristic. Over 200 community-developed plugins extend functionality with geotagging, social sharing, watermarking, facial recognition integration, mobile apps, and desktop client bridges to tools like digiKam, Lightroom, and Shotwell. Themes allow complete visual customization without touching core files. If you need a managed hosting alternative, piwigo.com offers a hosted version, but the self-hosted path gives you zero ongoing hosting fees and complete data sovereignty.

What You Get

  • Album Hierarchy - Create unlimited-depth nested album trees to give large collections a clear visual taxonomy, with support for virtual albums that link photos from multiple physical locations.
  • Batch Manager - Select hundreds of photos by date range, tag, or album and apply bulk actions — re-categorization, author assignment, geolocation, watermarking, and deletion — through a single queue-based interface.
  • Granular Privacy Controls - Assign access permissions at the individual photo or album level to specific users or user groups, so a single Piwigo instance can host both public galleries and password-protected private collections simultaneously.
  • Calendar & EXIF Date Browsing - Navigate your library by year, month, or day using EXIF capture dates automatically extracted from uploaded images, making chronological exploration of large archives effortless.
  • Plugin & Theme Ecosystem - Extend behavior with 200+ plugins installable from the admin panel, and override any template file or stylesheet through the theming system without touching core code.
  • Multi-Source Upload - Add images via web form, FTP, desktop clients like digiKam and Lightroom, dedicated mobile apps, or Piwigo’s own RESTful web services API — whichever workflow fits your production pipeline.
  • Web Services API - A full-featured REST API exposes categories, images, users, tags, comments, and permissions, enabling integrations with external tools, mobile apps, and automated pipelines.
  • Tag & Metadata Management - Tag photos individually or in bulk, search across tags and custom metadata fields, and display or hide any EXIF attribute on photo detail pages through configuration rather than code changes.

Common Use Cases

  • Professional photographer archive management - A photographer uses Piwigo’s hierarchical albums and EXIF date browser to navigate and curate a 100,000-image archive, sharing selected client galleries through password-protected albums without exposing the full collection.
  • Internal team photo library for marketing - A marketing team self-hosts Piwigo behind a corporate network, using user groups and album permissions to give agencies and vendors access to specific campaign assets while keeping unreleased content private.
  • Public travel or nature photography blog - A travel blogger hosts an SEO-optimized public gallery with social sharing plugins, comment moderation, and RSS feeds, driving traffic to a self-hosted site with no monthly SaaS fees.
  • Family photo preservation and sharing - A household migrates decades of family photos from scattered hard drives, uses Piwigo’s FTP sync and batch manager to ingest and organize them, and shares albums selectively with relatives through guest accounts.
  • School or nonprofit photo archive - An educational institution runs Piwigo to maintain a multi-year archive of event photos, using group permissions to let students and parents browse approved content while staff manage uploads.
  • Scientific or research image repository - A research team uses Piwigo’s metadata fields, web services API, and bulk ingestion tools to maintain a structured catalog of specimen photographs integrated with their own data pipelines.

Under The Hood

Architecture Piwigo is organized as a procedural PHP monolith where each public-facing URL maps to a dedicated top-level script — index.php, picture.php, search.php, tags.php — each of which bootstraps the application by including a shared common.inc.php bootstrap and then calls domain-specific function files. There is no framework-style request routing or controller dispatch; responsibility for a page lives in its script. The plugin system is the most architecturally notable feature: a publish-subscribe event bus implemented in functions_plugins.inc.php allows plugins to register handlers for named hooks scattered throughout the core, enabling them to intercept rendering, database queries, user actions, and template data without patching core files. Themes extend this with a layered template override system: any core Smarty template can be replaced by dropping a same-named file into the active theme directory. This hook-and-override model has proven durable across more than two decades, though it comes at the cost of implicit coupling between the core hook surface area and the plugin ecosystem.

Tech Stack The backend is PHP 7.4+ (with PHP 8.x fully supported in current releases), using Smarty as the templating engine with no external application framework. Database persistence is through a custom abstraction layer with a MySQLi driver, targeting MySQL 5+ or MariaDB-equivalent; schema migrations are handled by versioned upgrade scripts shipped with each release. The frontend is jQuery 3.x with custom event-driven UI components; there is no modern JavaScript build toolchain or module bundler. CSS is a mix of hand-authored stylesheets and Less/SCSS sources compiled during development, with no automated build pipeline included in the repository. Image processing is delegated to either ImageMagick (recommended) or PHP GD, both configured at install time. Deployment targets standard LAMP/LEMP environments via FTP or direct file upload; no Docker images or Kubernetes manifests are included in the upstream repository, though community-maintained containers exist.

Code Quality The codebase has no unit or integration test framework — the single test file in tools/ is a curl-based HTTP smoke test that hits a running Piwigo instance rather than testing logic in isolation. Error handling relies heavily on bare die() and trigger_error() calls rather than exceptions or structured error reporting, which makes error paths difficult to intercept or log cleanly. User input is sanitized at the bootstrap level via a global addslashes walk, a pattern that predates prepared statements; the database layer uses some query construction patterns that would benefit from parameterized queries throughout. PHP documentation comments (PHPDoc blocks) appear on many functions, particularly in the include/ layer, indicating that code documentation discipline improved over the project’s history. There is no enforced code style via a linter or formatter in the CI pipeline. The absence of automated tests is a significant structural risk for a project of this scope, though the long release history and active community serve as a practical quality gate.

What Makes It Unique Piwigo’s most distinctive technical contribution is its event-hook plugin API, which was designed from the beginning to allow deep behavioral extension without forking the core — a model that predates many modern plugin architectures and that has sustained an ecosystem of over 200 plugins maintained by an independent community. Its album permission model, which lets a single installation simultaneously serve public visitors, registered members, and admin-only content through layered group-based access rules, handles multi-audience photo sharing scenarios that most gallery software requires separate installations to address. The multi-source ingestion story — supporting FTP sync, RESTful web services, digiKam, Lightroom, Shotwell, and dedicated mobile apps — makes Piwigo unusual in its ability to fit into professional photography production workflows rather than requiring photographers to change how they work. Finally, the sheer depth of the web services API, exposing categories, images, users, tags, permissions, and comments as first-class REST resources, makes Piwigo a viable backend for custom gallery applications and automated asset management pipelines.

Self-Hosting

Piwigo is released under the GNU General Public License v2 or later (GPLv2+), one of the most widely used copyleft licenses in open source software. In plain language, you can use Piwigo commercially, modify it, and distribute it, but if you distribute a modified version you must release the source under the same license. For typical self-hosting scenarios — running Piwigo on your own server for your organization, clients, or public — the GPL imposes no restrictions on what you can do with the software or your photos. The license only becomes relevant if you package and distribute Piwigo itself to others.

Running Piwigo yourself means you are responsible for provisioning a LAMP or LEMP server (PHP 7.4+, MySQL/MariaDB, Apache or nginx), performing manual installs and upgrades (typically unzipping a release archive and running a web-based upgrade wizard), handling database backups, managing storage growth as your photo library expands, and keeping PHP and the web server patched. Piwigo is a mature application with detailed online documentation and an active forum community, which reduces the learning curve, but there is no automated patch delivery — you must monitor releases and apply them manually. For large libraries, storage planning and image processing performance (particularly ImageMagick configuration) require attention.

If you prefer not to manage infrastructure, piwigo.com offers a hosted version with tiered plans covering storage, user counts, and support levels. The hosted version handles upgrades, backups, and uptime but limits deep plugin or theme customization to what the platform allows. Self-hosters have unrestricted access to the full plugin ecosystem, can modify every template and configuration file, and keep their photo data on hardware they control — the primary trade-off is operational responsibility rather than feature access, since the community-supported self-hosted edition and the hosted edition share the same core codebase.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search