How to install latest Piwigo in CentOS 7.

share on:
How to install Piwigo in CentOS 7 with and without a Script.

Piwigo is fully featured open source photo gallery software. It is simple and flexible software and has lots of security configurations options. Lots of themes and plugins are available for Piwigo to make it more customizable.

In this tutorial, we will install and configure Piwigo on our CentOS 7 server.The installation process is really simple. I will be performing all the operations as root user and if you’re not running as root user then please use sudo with your commands.

Here’s a list of things we need to have before installing Piwigo server.

If you are in a hurry to install Piwigo in CentOS 7, then there is a link to a simple script at the end of this Post.


Install LAMP Stack.

To know how to install LAMP stack on CentOS 7, you can follow this post.

How to install LAMP on CentOS 7 with or without a script.


Set up a Database and User for Piwigo.

Make sure MariaDB/MySQL is running

[root@debyum ~]# systemctl status mysql.service
 ● mysql.service - LSB: start and stop MySQL
 Loaded: loaded (/etc/rc.d/init.d/mysql)
 Active: active (running) since Mon 2016-10-17 18:00:42 UTC; 1h 13min ago
 Docs: man:systemd-sysv-generator(8)
 CGroup: /system.slice/mysql.service
 ├─9745 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/
 └─9817 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --use...

Oct 17 18:00:41 debyum systemd[1]: Starting LSB: start and stop MySQL...
 Oct 17 18:00:41 debyum mysql[9739]: Starting MySQL.161017 18:00:41 mysqld_safe Logging to '/var/lib/mysql/debyum.err'.
 Oct 17 18:00:42 debyum mysql[9739]: SUCCESS!
 Oct 17 18:00:42 debyum systemd[1]: Started LSB: start and stop MySQL.


Create a database and user.

We will create a Database and user for that Database.

I will be using these values for this procedure.

  • Database Name: piwigo_db ( change it with your own Piwigo database name.)
  • Database User: piwigodb_user ( change it with your Piwigo database user.)
  • Database User’s Password: piwigodb_user_pwd ( change it with the password you want to assign to you Piwigo database user.)
 [root@debyum ~]# mysql -uroot -p
 Enter password:
 Welcome to the MariaDB monitor.  Commands end with ; or \g.
 Your MariaDB connection id is 16
 Server version: 10.1.18-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE piwigo_db;
 Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON piwigo_db.* to 'piwigodb_user'@'localhost' identified by 'piwigodb_user_pwd ';
 Query OK, 0 rows affected, 1 warning (0.00 sec)

 Query OK, 0 rows affected (0.01 sec)

mysql> quit


You will need to enter these details later while configuring Piwigo database.

  • Piwigo Database name.
  • Piwigo User name.
  • Piwigo User’s Password.

Now we have a database and a user for Piwigo.


Install Piwigo on CentOS 7.

Download Piwigo 2.8.2 and extract it in /var/www/html directory.

 [root@debyum ~]# curl -o
 [root@debyum ~]# unzip
 [root@debyum ~]# sudo rsync -avP piwigo/ /var/www/html/


Give Proper ownership to /var/www/html directory

[root@debyum ~]# chown -R apache:apache /var/www/html/



We will also install ImageMagick for Piwigo.

ImageMagick is a software suite to create, edit, compose, or convert bitmap images.
Imagemagick is much more efficient than the GD Graphics Library. It consumes fewer resources on the server and still renders higher quality pictures.

[root@debyum ~]# yum install ImageMagick -y


Editing php.ini for optimize performance.

[root@debyum ~]# sed -i '/memory_limit/c\memory_limit = 128M' /etc/php.ini
[root@debyum ~]# sed -i '/upload_max_filesize/c\upload_max_filesize = 16M' /etc/php.ini 
[root@debyum ~]# sed -i '/max_execution_time/c\max_execution_time = 60' /etc/php.ini 
[root@debyum ~]# sed -i '/;always_populate_raw_post_data/c\always_populate_raw_post_data = -1' /etc/php.ini


Set the date.timezone in php.ini. we will set date.timezone to America/Los_Angeles. You should set this to your timezone.

[root@debyum ~]# sed -i '/;date.timezone/c\date.timezone = America/Los_Angeles' /etc/php.ini


Now the Last thing to do is configure the Piwigo.


Install & Configure Piwigo.

To configure Piwigo, open a web browser and enter your server’s IP address:



Piwigo Basic, Database and Administration configuration.

You will see the Piwigo configuration page.

Fill the required information and click on Start Installation.


Piwigo installation complete

Your Piwigo installation is successful. Click on the Visit the gallery to go to the Admin home page.



Piwigo welcome page

You can click Start the Tour to know more about the Piwigo.

click “…or please deactivate this message, I will find my way by myself  to find your own way.


Piwigo gallery

Go to Piwigo admin page by visiting.




Piwigo Admin home page

You can manage Users, Albums and Plugins from here.

we will create a Photo Album and upload few photos in that album.



Create a new album in Piwigo

Click Manage to create a new album.



Create a new album in Piwigo

Enter the Name of Album and click Create.



Add photos in Piwigo

click add photos to upload some photos in that album.



Upload photos in Piwigo

You can add photos in this album either by clicking Add Photos or by dragging photos.



Photo uploaded in Piwigo

A photo has been Added to the album. Click Visit the gallery on the Top right to visit the Piwigo gallery.



Piwigo gallery view



Piwigo is really easy to install and has lots of features that can help you to manage your Photo albums.

Also, if you need a simple script to install Piwigo in CentOS 7 (test environments) then you should visit Page 2 of this article.

I have tried to cover all the basic to advance concepts with their examples.Still, if I have missed anything please update us through comment box. I will keep updating the same based on feedbacks. Thanks.



share on:


Hello there, My name is Rishi Guleria and I work as a Linux system administrator. I have created this blog to share what I have learned so far and to learn new things. Don't forget to leave the feedback. Have a great day. :)

Leave a Response

share on: