PiGallery2: Blazing Fast Photo Hosting on a Raspberry Pi

2022-09-10 13:49:34 By : Ms. Sally chen

If you can turn a Raspberry Pi into a web server, why not use it to share photos? Here is a remarkably quick way to do so.

While there are dozens of self-hosted photo gallery server projects available for the Raspberry Pi, PiGallery2 was designed for speed, low resource usage, and ease-of-use. Plus it was specifically built with the Raspberry Pi in mind. Here's how to install and use it.

PiGallery2 is a directory-first photo gallery website, optimized for running on low-end servers with limited resources—such as the original Raspberry Pi. It's developer, Bpatrik, describes it as "fast (like faster than your PC fast)" and "Fast, like for real".

PiGallery2 is also simple to use. Once set up, you can just point at the directory where your photos are kept, and PiGallery2 will do the rest.

You'll be pleased to learn that PiGallery2 is absurdly easy to set up and use.

After setting up your Raspberry Pi to act as a server, log in via SSH (secure shell), then update and upgrade any installed packages:

You now need to create a new directory for PiGallery2, plus subdirectories for config, images, and temporary files:

Use nano to create a new file in your home directory:

Save and exit nano with Ctrl + O then Ctrl +X

Tell Docker to pull the containers onto your system:

PiGallery2 is now up and running!

PiGallery2 creates galleries which can be viewed over the internet, based on images in the /home/pi/pigallery2/images directory. This is currently empty, so use secure copy to transfer image files and folders from your local machine:

Open a browser and navigate to your.local.pi.ip:80, and you will be prompted to log in. The default username is "admin", and the password is "admin".

The screen will populate with images from the "images" directory on your Pi, and you'll be able to see that the developers were telling the truth—PiGallery2 is blindingly fast. As fast, in fact as viewing photos in an app on your local machine. There isn't a whole lot to PiGallery2 than that.

PiGallery2 does one thing and does it exceptionally well. It serves photos fast—although it does not cope well with libraries of over 100,000 images, or individual albums of over 5,000 pictures. If you want more features from your Raspberry Pi photo management software, consider a more fully featured app such as PhotoPrism or a commercial hosting solution.

David is a freelance writer with a background in print journalism. He has written for newspapers in the United Kingdom and the Middle East. He is a terrible guitar player, and he spends his free time touring the British Isles, off-grid, with his caravan and dog. Occasionally, he writes books. No-one likes them.

Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!