DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
VGSources
Blog

How to Self-Host the Piwigo Photo Gallery on a Linux VPS

A complete guide to running Piwigo on your own Linux VPS, including requirements, Docker and manual installation steps, Nginx proxy settings, storage planning, backups, upgrades, and recovery checks.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To self-host Piwigo on a Linux VPS, provide a web server (Nginx or Apache), a MySQL-compatible database, PHP, an image-processing library, and storage for both your originals and Piwigo’s generated image sizes. You can deploy the official Docker stack or install the application into an existing web stack. Docker is more repeatable and isolated; a manual install integrates directly with the VPS. In either case, you configure the first administrator account in Piwigo’s browser installer, put the site behind TLS and a reverse proxy when appropriate, and maintain your own tested backups.

What a self-hosted Piwigo installation contains

Piwigo is open-source web gallery software. A VPS deployment is a small web application architecture rather than a single executable: the web server accepts requests, PHP runs Piwigo, a MySQL-compatible database stores application data, and ImageMagick or GD creates the sizes visitors view. Your original photographs remain on disk, while generated thumbnails and other multiple-size derivatives consume additional space.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Piwigo supports a normal domain, a subdomain, or a path such as /gallery. Keep the public directory name independent of the Piwigo release number. A release-number directory makes every upgrade a URL change; a stable name lets you replace application files or images without changing bookmarks.

Requirements and capacity planning

The current Piwigo requirements specify the following floors and components:

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Component Requirement or guidance Why it matters
Operating environment Linux VPS with SSH access for administration SSH is needed for Docker management and is the normal way to maintain a VPS.
Web server Nginx or Apache Serves static files and forwards dynamic requests to PHP or the Piwigo container.
PHP PHP 8.2 or newer Piwigo’s current dependency floor; check extensions required by your selected plugins as well.
Database MySQL 5.6 or newer, or MariaDB 10.1 or newer Stores users, albums, configuration, tags, and other gallery metadata.
Image processing ImageMagick recommended; GD is an alternative Generates thumbnails and other sizes displayed by the gallery.
Optional media tools ExifTool for metadata plugins; FFmpeg for the VideoJS poster-generation use case Needed only when your plugins or media workflow use those capabilities.
Disk space Enough for originals plus generated multiple-size caches Derivative files can substantially increase storage beyond the source library.

There is no universal CPU, RAM, or photo-count minimum published for every installation. Size the VPS from the number and resolution of originals, the amount of thumbnail generation during imports, concurrent visitors, and the plugins you enable. A small personal gallery and a large import run have very different bursts of CPU, memory, disk I/O, and temporary space. Leave headroom for database dumps and an upgrade staging copy instead of allocating only the current photo total.

Docker or manual installation?

Both routes are supported. Use the route that matches how you already operate Linux services.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision point Official Docker deployment Manual web-stack deployment
Isolation and repeatability Packages the Piwigo and database workflow in containers and records settings in compose.yaml and .env. Uses the VPS’s own PHP, web server, database, and filesystem layout.
Host integration Requires Docker networking, volumes, and a container-to-proxy connection. Fits directly into an existing Nginx or Apache virtual host and PHP setup.
Updates Pull the updated images, recreate the stack, and retain the compose and environment files. Check the new release requirements, then replace application files while preserving your data directories and configuration.
Troubleshooting Includes container status, service logs, volume ownership, database networking, and forwarded headers. Focuses on PHP modules, web-server permissions, database connectivity, and the uploaded file tree.

Docker is usually the easier choice when you want a reproducible deployment or do not want Piwigo’s PHP and database packages mixed with other sites. Manual installation is sensible when the VPS already has a carefully managed PHP stack, when your backup tooling expects ordinary directories, or when you prefer to debug services directly on the host.

Prepare the VPS before installing

  • Point a domain or subdomain at the VPS, or decide which path on an existing site will host the gallery. Do not include a Piwigo release number in that public path.
  • Enable SSH access and apply the operating system’s security updates before adding the gallery.
  • Choose Nginx or Apache and plan HTTPS termination. A reverse proxy is required for the documented Docker arrangement; a manually installed site can use the web server directly.
  • Reserve storage for originals, generated sizes, database dumps, temporary imports, and at least one maintenance copy. Monitor free space because an import can create many derivatives.
  • Decide where an off-site backup will live. A second disk, another server, or object storage is useful only if it is outside the VPS failure domain and can be restored.
  • Record the database name, database user, password, and table prefix you will use. Keep credentials out of public web directories and shell history where practical.

Route A: deploy the official Docker stack

1. Create a dedicated project directory

Log in over SSH, create a directory used only for Piwigo, and change into it. Download the official Piwigo compose.yaml into that directory. Keep this file under your normal configuration-backup process; it defines the services, volumes, and image versions used by the deployment.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

2. Set the environment values

Create the .env file expected by the downloaded compose file. Set the exposed web port, database password, and timezone. If the compose documentation offers UID and GID options, set them to the account or group that should own files written to mounted directories. Do not invent variable names: use the names present in the official file you downloaded, because those names are part of the stack’s interface.

Protect .env from the web root and from untrusted users. It contains secrets and deployment choices needed to recreate the gallery.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Start the services and read their logs

From the project directory, run:

docker compose up -d

Then inspect startup output:

docker compose logs

Confirm that both the Piwigo application and database services remain running. If a service exits, read its logs before repeatedly restarting it. Typical causes are an invalid environment value, a port already in use, insufficient permissions on a mounted directory, or a database that has not finished initializing.

4. Put the container behind Nginx

The Docker guide advises using Nginx as a reverse proxy. Create a server block for your domain or subdomain and proxy the public location to the port exposed by the Piwigo container. Pass these headers unchanged so Piwigo can construct correct links and log the real client address:

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
  • Host
  • X-Real-IP
  • X-Forwarded-For
  • X-Forwarded-Proto

Terminate TLS at Nginx, redirect plain HTTP to HTTPS, and ensure the proxy target is reachable only as intended. If the gallery is published under a subpath such as /gallery, also pass X-Forwarded-Prefix with that path. Test both the home page and a deep album URL after reloading Nginx; missing prefix or scheme headers commonly produce broken links, redirect loops, or assets requested from the wrong location.

5. Run Piwigo’s first-run installer

Open the public URL in a browser. An uninstalled container redirects to the setup page. In the documented compose arrangement, enter piwigo-db:3306 as the database host, then provide the database user, password, database name, and table prefix defined for your stack. Create the webmaster identifier, password, and email address, and select Start Install. When installation completes, sign in to the administration panel and remove any temporary setup material that the deployment documentation tells you to remove.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Route B: install Piwigo into the VPS web stack

1. Download and extract the full archive

Obtain Piwigo’s full release archive, extract it locally or on the VPS, and upload all extracted contents to the web root or to a stable directory such as photos. The manual guide mentions an FTP client, but any secure file-transfer method that preserves the complete tree is suitable on a VPS. Do not upload only a subset of files: plugins, administration code, and the installer are part of the archive.

2. Set ownership and web-server access

Make the files readable by the web-server account and make the directories that Piwigo must write to writable by that account. The exact account differs between Apache, Nginx with PHP-FPM, and distributions. Grant the minimum write access required rather than making the whole document root world-writable. If the installer reports a permission problem, correct ownership and mode on the named directory, then reload the page.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

3. Complete the browser installer

Open the stable gallery URL. Piwigo detects that the instance is not installed and redirects to its installer. Enter the database host, user, password, database name, and table prefix. Create the webmaster identifier, password, and email address, submit the installation, and sign in to administration. Keep the public directory name stable so a later release replacement does not change the URL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After the first login

  • Confirm that the administration panel loads over HTTPS and that a normal visitor can open an album, an individual photo, and a generated size.
  • Upload a small test set and verify that thumbnails and other sizes are created. If generation fails, check ImageMagick or GD availability and the write permissions on the gallery directories.
  • Check the server’s PHP version against the current requirement before enabling plugins. A plugin can impose additional PHP extensions beyond Piwigo’s base requirement.
  • For metadata-heavy workflows, install and test ExifTool only if the plugin you use requires it. For VideoJS poster generation, install and test FFmpeg.
  • Set a routine for operating-system updates, Piwigo updates, database dumps, and free-space alerts. Record the exact Docker compose directory or manual document-root location so another administrator can recover it.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Backups and upgrades

What to back up before a Docker update

Before changing images or compose settings, create a database dump and copy all of these artifacts:

  • The galleries directory containing your original gallery files.
  • The upload directory containing uploaded files.
  • The local directory containing local configuration and customizations.
  • compose.yaml, which defines the stack.
  • .env, which contains deployment values and secrets.

Photo directories can consume substantial space, so check the destination’s capacity before copying. Keep at least one backup away from the VPS and periodically perform a restore test: import the database dump into a disposable database and restore the directories into a test instance or a controlled recovery location. A backup that has never been read or restored is an assumption, not a verified recovery plan.

Manual-install upgrade discipline

For a manual installation, read the target release requirements first, make the same database and file backups, and preserve the galleries, upload, and local content while replacing application files from the new archive. Keep the web-server and PHP configuration under version control or in your infrastructure notes so a package update does not silently remove a required extension or change the PHP-FPM account.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Ownership checks after maintenance

The official Piwigo CLI can diagnose ownership and perform gallery database backups. Its documentation notes that the web-server user differs between plain Apache, Docker, and other setups. Run ownership diagnostics after an update or restore, especially if files were copied as root or extracted by a different account. Correct ownership before testing uploads; otherwise the first symptom may be a failed thumbnail job rather than an obvious permission error.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Storage, performance, and reliability decisions

Estimate storage from derivatives, not originals alone

Piwigo creates multiple sizes for browsing. The source library may fit comfortably while the generated cache does not, particularly when importing high-resolution images or enabling many size configurations. Track the growth of the original directories and generated directories separately, reserve room for temporary processing, and avoid filling the filesystem to its limit because the database and web server also need working space.

Match the VPS to the workload

There is no published one-size-fits-all CPU or RAM recommendation. A private gallery with occasional uploads can use a smaller instance than a public library with many simultaneous visitors and a large initial resize job. Increase resources when imports monopolize CPU, PHP workers queue, database requests become slow, or disk I/O remains saturated. Measure your own workload rather than treating an unqualified provider size as a Piwigo requirement.

Design for failure

Self-hosted operators own the backup and redundancy design. Piwigo’s hosted service advertises regular backups and replication to a standby server, but a VPS installation does not acquire those protections automatically. Your plan should specify where the database dump and photo copies go, how often they are made, how long they are retained, who can decrypt or access them, and the recovery steps for a failed disk or an incorrect upgrade.

Troubleshooting by symptom

Symptom Checks Likely correction
The browser cannot connect Check the container status, the exposed port, Nginx’s upstream target, firewall rules, and docker compose logs. Free the conflicting port, correct the proxy target, or fix the service that exited.
Redirect loop or HTTP links behind HTTPS Verify that Nginx passes X-Forwarded-Proto and that TLS termination and the public URL agree. Correct the forwarded scheme and reload Nginx.
Broken links only under /gallery Check that the proxy sends X-Forwarded-Prefix /gallery and that the location mapping preserves the path. Fix the prefix header or location configuration.
Installer cannot reach the database Confirm the database host and port, credentials, service name, and that the database container is healthy. Use the compose network hostname and port documented for your stack, then inspect database logs.
Uploads or thumbnails fail Check web-server ownership, free disk, PHP limits, and whether ImageMagick or GD is installed and callable. Correct permissions, free capacity, adjust the applicable PHP limits, or install the selected image library.
Files work before an update but not afterward Compare ownership and modes, confirm that local and the data directories were restored, and review CLI diagnostics. Restore the preserved directories and assign them to the account used by the current web server or container.

Operational checklist

  1. Verify PHP 8.2 or newer, a supported MySQL or MariaDB version, and ImageMagick or GD.
  2. Choose Docker or manual installation based on isolation versus host integration.
  3. Use a stable domain, subdomain, or path that does not contain the release number.
  4. Deploy over HTTPS; for Docker, proxy through Nginx and pass all required forwarded headers.
  5. Complete the browser installer and test an upload, thumbnail, album, and administration login.
  6. Back up the database, galleries, upload, local, compose.yaml, and .env before updates.
  7. Store a copy off the VPS and verify that both database and file restores work.
  8. After maintenance, check ownership with the Piwigo CLI or equivalent filesystem checks.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.