Piwigo and Raspberry PI: a Private Open Source Photo Management Platform

0
(0)

Keeping your pictures and videos in smartphones can suddenly drain your storage space. Piwigo with Raspberry PI can save your space and give you more features to manage them privately

In this tutorial, I’m going to show you how to install Piwigo on your Raspberry PI computer board. It can also be considered a great Google Photo alternative, as the Google service requires a paid subscription once you require more space. An important thing is, after the Piwigo installation, to use the official users manual to keep our files secure from any outage with periodic backups.

About Piwigo

Basically, Piwigo is an open source photo management software. It is built on a client-server architecture: all the specific software needed to run the platform is installed in your server (Raspberry PI according to this tutorial). You can use the platform both from a common web browser or from Piwigo client applications available both for Android and Apple devices. For desktop clients, you can use Piwigo with desktop applications like digiKam, Shotwell and Lightroom or FTO clients.

The server component can be installed both in a local computer or can be served from the Piwigo cloud. The latter can be get by subscribing to their cloud plans, but you can self-host Piwigo locally without any fee.

The aim of this software is to enhance photo management, by making it simpler to edit them in batch or filtering images by collections, dates and tags.

Another interesting feature is that you can use the plugin for Google Maps or OpenStreetMap in order to browse your pictures based on the geo metadata on an interactive map.

Piwigo is highly customizable in an easy manner: just browse their themes and plugins, choose your preferred one and click “install” to get it installed.

Finally, you can publish your Piwigo pictures to external users, allowing them to post comments, rates, mark photos as favourites, perform searches and get notified of news by email. With a few more hardware you can also create your digital frame and photo management platform hosted on the same RPI running the Raspberry PI in kiosk mode (Raspberry PI OS Desktop is required in this case, but all the remaining steps from this guide remain the same).

For this tutorial, I’m going to use a Raspberry PI 3 Model A+, but you can use these steps with any Raspberry PI computer board.

What We Need

As usual, I suggest adding from now to your favourite e-commerce shopping cart all needed hardware, so that at the end you will be able to evaluate overall costs and decide if continue with the project or remove them from the shopping cart. So, hardware will be only:

raspberry pi 3 model A+

Check hardware prices with the following links:

Amazon raspberry pi boards box
Amazon Raspberry PI 3 Model A+ box
Amazon Micro SD box
Amazon Raspberry PI Power Supply box

Step-by-Step Procedure

Prepare The Operating System

Please start with OS installation. You can use both Raspberry PI OS Lite (to get a fast, headless OS) or Raspberry PI OS Desktop (a little slower, but including a full desktop environment).

Make sure that your OS is up to date. From the terminal, please use the following command:

sudo apt update -y && sudo apt upgrade -y

You can now proceed with the next steps by installing LAMP in your Raspberry PI.

Add the required packages

Install the required php modules/packages, according to Piwigo requirements:

  • imagick > we’ll install it
  • gd > we’ll install it
  • exif: already included in php-common
  • mbstring (even if not required, I’ve tested that the installation has issues without it) > we’ll install it
  • ffmpeg > we’ll install it

You can get them satisfied with the following terminal command:

sudo apt install php-imagick php-gd ffmpeg php-mbstring -y

Finally, restart the Apache service:

sudo systemctl restart apache2.service

Configure MariaDB for Piwigo

Log into MariaDB shell as root:

sudo mariadb -u root

Create a database for Piwigo (I called it “piwigo”, but you can name it as you prefer):

create database piwigo;

grant all privileges of Piwigo database to the user (with password) that you will configure in Piwigo in the next steps. Please use your favourite database name, DB user and DB password instead of red ones (respectively piwigo, piwigouser and piwigopassword):

grant all privileges on piwigo.* to piwigouser@localhost identified by 'piwigopassword';

Flush the privileges table for the changes to take effect and then exit

flush privileges;
exit;

Install Piwigo in your Raspberry PI

Now we can proceed with the real Piwigo installation. I’ll use the netinstall method, as it makes the installation procedure far simpler.

Download the netinstall script directly in your Raspberry PI and move it to the Apache public folder. Finally, assign the proper privileges to the public folder in order to make it possible for Piwigo installer to do its job:

curl https://piwigo.org/download/dlcounter.php?code=netinstall -o piwigo-netinstall.php
sudo mv piwigo-netinstall.php /var/www/html/
sudo chown -R www-data:www-data /var/www/html/

From here, we can use a remote browser to complete the steps. Use your Raspberry PI’s IP address, followed by the “piwigo-netinstall.php” page. That means, for example, being my local RPI IP address 192.168.1.177, my URL will be “http://192.168.1.177/piwigo-netinstall.php”. You will get the first page inviting you to select your language and destination folder:

Piwigo netinstall start

Please click the “Retrieve and unzip Piwigo” button to allow the netinstaller to download the required packages. Once the process finishes, you will have a confirmation page:

Piwigo netinstall retrieved ready to install

Click “Install Piwigo now”. In the next window, you will have to add your database name, DB user and DB password (according to what was set in the previous “Configure MariaDB for Piwigo” step. Moreover, you will need to choose the administrator username, password and email address. These credentials will be the ones you will use to access the web dashboard:

Piwigo netinstall settings

We are near the installation end… Click “Start Installation” and a confirmation message will be shown once all have been completed successfully:

piwigo installation successful

From here, please click the “Visit the gallery” button. Your installation is still empty, so Piwigo is just advising you that your Gallery hasn’t any content:

Piwigo welcome gallery empty

With the “I want to add photos” button, you will go to the Piwigo dashboard:

Piwigo home

Piwigo installation in your Raspberry PI ended. Once added the first pictures, considering your Raspberry PI IP address instead of the “RPI_address” label, you will have:

  • http://RPI_address/piwigo -> from this page you will reach your photo management dashboard
  • http://RPI_address/piwigo/admin.php -> from this page you will reach the administration dashboard (only for administrator users)

From here, you can use the official Piwigo user manual, even if the interface is more than intuitive. A few more examples will be shown in the next chapters.

Change Piwigo Theme

Piwigo offers a lot of free themes that can be installed with a few clicks. Please note that themes apply only to the photo management pages, while the administration dashboard will probably remain unchanged even with different themes.

Once logged with the administrator user, from the left sidebar please click Configuration, then select themes:

piwigo select themes menu

You will reach the Themes menu, which shows all the installed themes. To search for new themes, please use the “Add a new Theme” tab:

piwigo add new theme menu

The new page will show a lot of free themes available for installation. Choose your favourite and click the “Install button” for that theme:

piwigo install theme

A message will notify that the new theme is installed, even if still not active:

piwigo theme installed

Go back to the “Installed Themes”. In my case, I’ve been “unlucky” as the theme I’ve chosen requires a root theme. This is shown by passing the mouse over the installed theme:

piwigo themes requires the root theme

Of course, this depends on what theme you have selected and installed. In my case, I have to go back to the “Add a new theme” to identify the required theme “Pure_default” and install it. Once done, my favourite theme becomes activable (as the Activate button changes color):

piwigo themes activable

Click Activate button. In this way you will make the new theme available for users, as it will be listed in “Active Themes” section:

piwigo new theme active

You can also “Set as default” the theme, so that users will find it active from the first time the connect your Piwigo pages. As said, it will not apply to the Administration pages, but moving to “http://RPI_address/piwigo” URL will show the new theme:

piwigo new theme applied

What’s Next

Interested in more cool ways to use your RPI? Take a look at peppe8o Raspberry PI computer tutorials!

Enjoy your Piwigo on Raspberry PI!

How useful was this post?

Click on a star to rate it anonymously!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?