Install Piwigo on the One-Click LEMP Application

Updated on November 21, 2023
Install Piwigo on the One-Click LEMP Application header image

Introduction

Piwigo is a popular open-source photo gallery software. In this article, I will show you how to install Piwigo on a Vultr server based on the One-Click LEMP application.

Prerequisites

  • Deploy a One-Click LEMP Vultr app.
  • Login to the app VPS over SSH as root (otherwise you may use sudo).

Step one: Create a database

Display the MySQL root password on your terminal.

cat /root/.my.cnf

Use the root password to log into the MySQL console.

mysql -u root -p

Create and configure a database in MySQL with the following commands. Remember to replace the database name piwigo, the user name myusername, and the password mypassword with your own ones.

create database piwigo;
create user 'myusername'@'localhost' identified by 'mypassword';
grant all privileges on piwigo.* to 'myusername'@'localhost' identified by 'mypassword' with grant option;
flush privileges;
exit;

Step two: Download the Piwigo NetInstall script

Piwigo can be installed with a single NetInstall script or a full archive package. As a matter of convenience, we will use the former.

First, you need to delete the default files that were created by Vultr.

cd /usr/share/nginx/html/
rm -f background.jpg index.php logo.png

Visit the Piwigo offical website from your browser, click the button Download NetInstall to download the script named piwigo-netinstall.php to your local machine. Then, upload it to the directory /usr/share/nginx/html/ on your Vultr VPS with your SCP client of choice.

Step three: Configure and install Piwigo from your browser

Before the installation, you need to add write permissions to the directory /usr/share/nginx/html/, or you will encounter a permission error.

chmod -R a+w /usr/share/nginx/html/

Visit http://[SERVER_IP]/piwigo-netinstall.php in your browser. Substitute the [SERVER_IP] with the IP address of your VPS. Follow the on-screen instructions to configure Piwigo.

On the page of "Welcome to NetInstall", you can choose the language and install destination.

For this article, we will choose to install Piwigo in the root directory. Delete "piwigo" from the textbox. Alternatively, you could specify another destination.

Click the button "Retrieve and unzip Piwigo".

On the page of "Congratulations!", click "Install Piwigo now".

On the page of "Configurations", you need to input parameters as specified below.


Basic configuration

Pick a language as you wish.

Database configuration

Host: localhost
User: myusername
Password: mypassword
Database name: piwigo
Database table prefix: piwigo_

Remember to replace the database user myusername, the database password mypassword, the database name piwigo, and the database table prefix piwigo_ with your own ones. Do not modify the "Host" field.

Administration configuration

Specify administrator's username, password and email address.


Click "Start installation".

On the page of "Congratulations!", click "Visit the gallery".

You may see a warning message.

Warning: strftime(): It is not safe to rely on the system's timezone settings. 

To fix the warning, you need to modify the php.ini file.

vi /etc/php.ini

Locate the following line.

;date.timezone = 

Assuming that your VPS has been deployed at "Los Angeles, California", you need to update the line as follows.

date.timezone = America/Los_Angeles

If your VPS will be deployed at another location, you can find the appropriate value from https://php.net/manual/en/timezones.php.

Save and quit vi.

:wq

To put these changes into effect, you need to restart the web server:

service nginx restart && service php-fpm restart

That's it. You have installed Piwigo onto your Vultr VPS. Visit http://[SERVER_IP]/ to start to use it.