The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →This guide installs Piwigo natively on Ubuntu Server 24.04 LTS with Nginx, PHP-FPM and MariaDB. You will finish with a gallery at https://gallery.example.com, HTTPS, image processing, uploads and a database account that is separate from MariaDB root.
The architecture is:
Browser → HTTPS → Nginx → PHP-FPM → Piwigo → MariaDB
Requirements and planning
- A fully updated Ubuntu Server 24.04 LTS system and a sudo-capable account.
- SSH access and a domain or subdomain such as
gallery.example.com. Point DNSAand, where applicable,AAAArecords at the server. - Storage for original photos, generated multiple-size images, thumbnails, the database and backups. Piwigo’s generated cache can consume substantial additional space.
- A backup destination on different storage from the live server.
Piwigo currently documents Nginx or Apache, MariaDB 10.1+ or MySQL 5.6+, PHP 8.2+, and ImageMagick or GD. See the current requirements. As of August 18, 2026, the GitHub repository listed 16.4.0 (released May 3, 2026), but use the official download page rather than embedding a release number in commands.
As an Amazon Associate I earn from qualifying purchases.
Native installation or Docker?
This article uses the full archive and system services. It gives direct Ubuntu paths, logs and service controls. Docker offers isolation and repeatability but requires Docker, persistent-volume and reverse-proxy administration; follow Piwigo’s Docker guide for that architecture. NetInstall is convenient, but a browser-downloaded installer script must be removed afterward.
Update Ubuntu and install the stack
sudo apt update
sudo apt full-upgrade -y
sudo reboot
Reconnect, then install Nginx, MariaDB, PHP-FPM, database and image extensions:
#1 Best Overall
- Entry-level NAS Personal Storage:UGREEN NAS DH2300 is your first and best NAS made easy. It is designed for beginners who want a simple, private way to store videos, photos and personal files, which is intuitive for users moving from cloud storage or external drives and move away from scattered date across devices. This entry-level NAS 2-bay perfect for personal entertainment, photo storage, and easy data backup (doesn't support Docker or virtual machines).
- Set Your Devices Free, Expand Your Digital World: This unified storage hub supports massive capacity up to 64TB.*Storage drives not included. Stop Deleting, Start Storing. You can store 22 million 3MB images, or 2 million 30MB songs, or 43K 1.5GB movies or 67 million 1MB documents! UGREEN NAS is a better way to free up storage across all your devices such as phones, computers, tablets and also does automatic backups across devices regardless of the operating system—Window, iOS, Android or macOS.
- The Smarter Long-term Way to Store: Unlike cloud storage with recurring monthly fees, a UGREEN NAS enclosure requires only a one-time purchase for long-term use. For example, you only need to pay $459.98 for a NAS, while for cloud storage, you need to pay $719.88 per year, $2,159.64 for 3 years, $3,599.40 for 5 years. You will save $6,738.82 over 10 years with UGREEN NAS! *NAS cost based on DH2300 + 12TB HDD; cloud cost based on 12TB plan (e.g. $59.99/month).
- Blazing Speed, Minimal Power: Equipped with a high-performance processor, 1GbE port, and 4GB RAM on Board, this NAS handles multiple tasks with ease. File transfers reach up to 125MB/s—a 1GB file takes only 8 seconds. Don't let slow clouds hold you back; they often need over 100 seconds for the same task. The difference is clear.
- Let AI Better Organize Your Memories: UGREEN NAS uses AI to tag faces, locations, texts, and objects—so you can effortlessly find any photo by searching for who or what's in it in seconds. It also automatically finds and deletes similar or duplicate photo, backs up live photos and allows you to share them with your friends or family with just one tap. Everything stays effortlessly organized, powered by intelligent tagging and recognition.
sudo apt install -y
nginx mariadb-server php-fpm php-mysql php-gd php-imagick
php-curl php-xml php-mbstring php-zip php-intl
imagemagick unzip curl
Ubuntu 24.04 commonly supplies PHP 8.3, but do not assume that minor version permanently. Check what is installed:
nginx -v
php -v
mariadb --version
php -m | grep -E 'curl|gd|imagick|intl|mbstring|mysqli|mysql|PDO|xml|zip'
systemctl list-unit-files --type=service | grep fpm
Enable services, substituting the FPM service name shown on your system:
sudo systemctl enable --now nginx
sudo systemctl enable --now mariadb
sudo systemctl enable --now php8.3-fpm
Find the actual FastCGI socket before writing Nginx configuration:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutels -l /run/php/php*-fpm.sock
Create and secure MariaDB
sudo mariadb-secure-installation
Remove anonymous users, disallow remote root login, remove the test database and reload privilege tables. Then create a dedicated database and account:
sudo mariadb
CREATE DATABASE piwigo
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;
CREATE USER 'piwigo'@'localhost'
IDENTIFIED BY 'REPLACE_WITH_A_LONG_RANDOM_PASSWORD';
GRANT ALL PRIVILEGES ON piwigo.* TO 'piwigo'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Use localhost, user piwigo, database piwigo and table prefix piwigo_ in the web installer. Piwigo’s manual guide recommends a prefix, particularly when a database is shared. Do not expose port 3306 publicly.
Download and install Piwigo
Use the official download page so the command remains current:
Rank #2
- 【Advanced Home Data & Media Hub】For advanced home users who need phone backup, file storage, and centralized data management. Centralize family photos, 4K videos, movies, computer backups, and personal files in one place while running multiple apps for home entertainment and everyday data management. Suitable for households with growing digital libraries and multiple NAS use cases.
- 【Built for Creators, Media Servers & Advanced Apps】Powered by the Intel N100 Quad-Core CPU, 8GB DDR5 RAM, 2.5GbE networking, and dual M.2 NVMe slots, DXP2800 handles large files and heavier workloads with ease. Run Docker, virtual machines, and media server applications compatible with Plex—ideal for content creators, tech enthusiasts, and advanced home users managing 4K videos, RAW photos, personal media libraries, and multiple NAS apps.
- 【Up to 80TB for Growing Digital Libraries】 Supports up to 80TB of storage using two HDD bays and two M.2 NVMe SSD slots for family photos, movies, RAW photos, 4K videos, work files, and device backups. AI photo management supports recognition of people, objects, scenes, and locations, album organization, and duplicate photo detection. HDDs and SSDs are not included.
- 【AI-powered Home Surveillance】Turn DXP2800 into a centralized home surveillance hub by connecting compatible network cameras and storing recordings locally on your NAS. AI-powered features include Face Recognition, People Detection, and Pet Detection, helping advanced home users review important events more efficiently while managing home surveillance and personal data in one place.
- 【One data Center Across Your Devices】Keep files from desktops, laptops, phones, tablets, and other devices together instead of scattered across cloud accounts and external drives. Access, back up, organize, and share data across Windows, macOS, Android, iOS, web browsers, and compatible smart TVs—ideal for creators and advanced home users working across multiple devices.
cd /tmp
curl -L 'https://piwigo.org/download/dlcounter.php?code=latest' -o piwigo.zip
unzip piwigo.zip
find . -maxdepth 2 -type f -name 'index.php' -print
Move the extracted directory (rename a versioned directory if necessary) to a stable path:
sudo mkdir -p /var/www
sudo mv piwigo /var/www/piwigo
Keeping release numbers out of paths prevents upgrades from changing the public URL. A straightforward permission model is:
sudo chown -R www-data:www-data /var/www/piwigo
sudo find /var/www/piwigo -type d -exec chmod 755 {} ;
sudo find /var/www/piwigo -type f -exec chmod 644 {} ;
This is simple, but broad ownership gives the web account control of application code. A hardened deployment can keep code owned by root and grant www-data write access only to the directories Piwigo actually needs, especially /var/www/piwigo/_data/. Recheck those directories after upgrades.
Configure Nginx and PHP-FPM
Create /etc/nginx/sites-available/piwigo:
server {
listen 80;
listen [::]:80;
server_name gallery.example.com;
root /var/www/piwigo;
index index.php index.html;
client_max_body_size 256M;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location ~ /.ht {
deny all;
}
}
Replace the hostname and socket with your values. The try_files rule routes unknown URLs to Piwigo; Apache directives such as AllowOverride and .htaccess rules do not belong here. The upload limit is only one half of upload sizing; PHP must allow at least the same amount.
sudo ln -s /etc/nginx/sites-available/piwigo /etc/nginx/sites-enabled/piwigo
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl reload nginx
Do not reload unless the test reports syntax is ok and test is successful.
Open the firewall
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
sudo ufw status verbose
If the profile is unavailable, allow 80/tcp and 443/tcp explicitly. UFW is Ubuntu’s standard firewall tool; see its firewall documentation. Never open MariaDB unless remote access is deliberately restricted.
Rank #3
- Value NAS with RAID for centralized storage and backup for all your devices. Check out the LS 700 for enhanced features, cloud capabilities, macOS 26, and up to 7x faster performance than the LS 200.
- Connect the LinkStation to your router and enjoy shared network storage for your devices. The NAS is compatible with Windows and macOS*, and Buffalo's US-based support is on-hand 24/7 for installation walkthroughs. *Only for macOS 15 (Sequoia) and earlier. For macOS 26, check out our LS 700 series.
- Subscription-Free Personal Cloud – Store, back up, and manage all your videos, music, and photos and access them anytime without paying any monthly fees.
- Storage Purpose-Built for Data Security – A NAS designed to keep your data safe, the LS200 features a closed system to reduce vulnerabilities from 3rd party apps and SSL encryption for secure file transfers.
- Back Up Multiple Computers & Devices – NAS Navigator management utility and PC backup software included. NAS Navigator 2 for macOS 15 and earlier. You can set up automated backups of data on your computers.
Run the Piwigo installer
Open http://gallery.example.com. Enter:
- Database host:
localhost - Database user:
piwigo - Database password: the random password created above
- Database name:
piwigo - Table prefix:
piwigo_
Create a strong webmaster password and provide an administrator email. After completion, check for installer remnants and remove only confirmed scripts:
sudo find /var/www/piwigo -maxdepth 2 -type f
( -name 'install.php' -o -name '*netinstall*' ) -print
sudo rm -f /var/www/piwigo/install.php /var/www/piwigo/piwigo-netinstall.php
Enable HTTPS
For an internet-facing gallery, obtain a trusted certificate. DNS must resolve correctly and ports 80 and 443 must be reachable:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d gallery.example.com
sudo nginx -t
sudo systemctl reload nginx
sudo certbot renew --dry-run
Certbot normally adds HTTP-to-HTTPS redirection. Use an internal CA for private organizational sites; self-signed certificates are for testing, not production, as Ubuntu explains in its certificate guidance. Behind Cloudflare or another TLS-terminating proxy, ensure the proxy forwards the original HTTPS scheme and uses a compatible TLS mode to avoid redirect loops.
Set PHP upload limits
Edit the FPM php.ini, commonly /etc/php/8.3/fpm/php.ini:
upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 300
max_input_time = 300
memory_limit = 256M
These are starting points, not Piwigo requirements. Choose values for your image sizes and available memory; post_max_size must be at least upload_max_filesize.
sudo systemctl restart php8.3-fpm
sudo nginx -t
sudo systemctl reload nginx
Verify uploads and image processing
For a temporary execution test:
echo '
Visit https://gallery.example.com/php-test.php and verify PHP executes, MySQL support exists, GD or Imagick is loaded and limits are suitable. Remove it immediately:
Rank #4
- Entry-level NAS Home Storage: The UGREEN NAS DH4300 Plus is an entry-level 4-bay NAS that's ideal for home media and vast private storage you can access from anywhere and also supports Docker but not virtual machines. You can record, store, share happy moment with your families and friends, which is intuitive for users moving from cloud storage, or external drives to create your own private cloud, access files from any device.
- Smart Photo Backup & AI Album: Automatically back up photos and videos from your phone in real time and keep growing family memories organized with AI-powered photo albums. Semantic search, custom learning, and recognition of people, objects, pets, and similar photos help you quickly find the moments you want. Duplicate photo removal also helps keep your library organized—ideal for families and users with large photo collections.
- User-Friendly App & Easy Setup: Connect quickly via NFC, set up simply and share files fast on Windows, macOS, Android, iOS, web browsers, and smart TVs. You can access data remotely from any of your mixed devices. What's more, UGREEN NAS enclosure comes with beginner-friendly user manual and video instructions to ensure you can easily take full advantage of its features.
- More Cost-effective Storage Solution: Unlike cloud storage with recurring monthly fees, A UGREEN NAS enclosure requires only a one-time purchase for long-term use. For example, you only need to pay $629.99 for a NAS, while for cloud storage, you need to pay $719.88 per year, $1,439.76 for 2 years, $2,159.64 for 3 years, $7,198.80 for 10 years. You will save $6,568.81 over 10 years with UGREEN NAS! *NAS cost based on DH4300 Plus + 12TB HDD; cloud cost based on 12TB plan (e.g. $59.99/month).
- Your Data, You Control:No third-party clouds, no hidden access, UGREEN NAS provides a more secure and private data storage solution. It stores data locally on your private hard drives and does automatic backups. Thus, you can keep full control over it. The advanced encryption is TRUSTe certified in the United States and is awarded the first (and only) ETSI EN 303 645 certification mark for NAS products by TÜV SÜD Group.
sudo rm /var/www/piwigo/php-test.php
Then create an album, upload a photo and confirm a thumbnail, resized image and expected EXIF data are produced. Piwigo recommends ImageMagick for image processing; GD is a practical alternative. exiftool may be needed by metadata plugins and ffmpeg by VideoJS:
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsconvert -version
php -m | grep -E 'gd|imagick'
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting
502 Bad Gateway
Check that FPM is running and that Nginx uses the existing socket:
systemctl status php8.3-fpm
ls -l /run/php/
sudo journalctl -u php8.3-fpm -n 100 --no-pager
sudo tail -n 100 /var/log/nginx/error.log
Update fastcgi_pass after PHP upgrades if the socket name changed.
Nginx test failure
Run sudo nginx -t and correct missing semicolons, duplicate names, stale symlinks, an incorrect root or socket. Never reload a failing configuration.
Database connection errors
sudo systemctl status mariadb
sudo mariadb -e "SHOW DATABASES;"
mariadb -u piwigo -p -h localhost piwigo
Verify the host, database, username, password and the 'piwigo'@'localhost' restriction.
Permission errors or failed uploads
sudo namei -l /var/www/piwigo
sudo find /var/www/piwigo -maxdepth 2 -type d -name '_data' -ls
sudo tail -n 100 /var/log/nginx/error.log
sudo journalctl -u php8.3-fpm -n 100 --no-pager
Confirm writable data directories. Recursive chown -R www-data:www-data is a broad convenience repair, not the preferred hardened policy.
Best Value
- Secure private cloud - Enjoy 100% data ownership and multi-platform access from anywhere
- Easy sharing and syncing - Safely access and share files and media from anywhere, and keep clients, colleagues and collaborators on the same page
- Automated Backup Protection - Set-and-forget backups for Macs, PCs and mobile devices to multiple destinations including cloud and external drives
- Home Security System - Record and monitor your property 24/7 with support for multiple IP cameras and remote viewing
- 2-Year Warranty - Reliable hardware backed by Synology's expert customer support team and ongoing software updates
Missing thumbnails
Check ImageMagick/GD, restart FPM after installing extensions, inspect ImageMagick policy restrictions, verify _data write access and consider memory or execution-time limits. Corrupt or unusually large source files can also fail.
Large uploads rejected
Align Nginx client_max_body_size with both PHP limits, and check any CDN, reverse proxy or provider limit.
Subdirectory installations
https://example.com/photos/ can work, but a subdomain is simpler because base paths, rewrites and asset URLs require less customization.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Backups, updates and logs
Back up the database, originals, configuration, plugins/themes and generated data if you want to avoid regenerating thumbnails. Store backups elsewhere:
sudo mariadb-dump --single-transaction piwigo
| gzip | sudo tee /var/backups/piwigo-$(date +%F).sql.gz >/dev/null
sudo rsync -aHAX --delete /var/www/piwigo/ /backup-location/piwigo/
Before upgrades, back up both database and files, record plugins and themes, read Piwigo release notes, check PHP and plugin compatibility, and test an important gallery in staging. Ubuntu security updates may be automatic, but Piwigo, plugins, themes and your operational configuration remain your responsibility. Useful logs include:
/var/log/nginx/access.log /var/log/nginx/error.log /var/log/php8.3-fpm.log
sudo tail -f /var/log/nginx/error.log
sudo journalctl -u nginx -f
sudo journalctl -u php8.3-fpm -f
PHP-FPM log names vary with the installed PHP version. Resource needs depend on photo count and dimensions, concurrent users, plugins, video processing and thumbnail workload; there is no universal RAM or CPU minimum.
When self-hosting is the wrong fit
Self-host when you need control over storage, networking and Nginx and are comfortable maintaining Linux services. Piwigo Cloud is a better fit when you want the gallery without maintaining the server, certificates, backups and updates; Piwigo advertises a 30-day trial with no credit card on its cloud page. Organizations that want self-hosting with vendor assistance can review professional support, listed at €990 per year excluding tax. VPS providers such as DigitalOcean, Hetzner and OVHcloud provide infrastructure, not Piwigo operations; compare storage, backups, bandwidth, IPv4/IPv6, location and support before choosing.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
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.




