Installing Piwigo on Ubuntu Server
Piwigo is a popular open-source photo gallery software that allows you to create and manage your own photo gallery website. In this tutorial, you will learn how to install Piwigo on Ubuntu Server latest.
Prerequisites
Before you start, there are some prerequisites you need to follow:
- A running Ubuntu Server latest.
- A terminal with sudo access.
Step 1: Install Apache and PHP
Piwigo requires a web server and PHP. Install the Apache web server and PHP by running the following command in your terminal:
sudo apt update
sudo apt install apache2 php libapache2-mod-php php-gd php-mysql
Step 2: Install Piwigo
Next, you need to download Piwigo and move it to the appropriate directory. To do that, follow the steps below.
Download Piwigo
Download the latest version of Piwigo from the official website. Run the following command to download Piwigo.
wget https://piwigo.org/download/dlcounter.php?code_version=11.5.0
Extract Piwigo
Once you have successfully downloaded Piwigo, extract it by running the following command:
tar xzf dlcounter.php?code_version=11.5.0
rm dlcounter.php?code_version=11.5.0
Move Piwigo
Next, move Piwigo to your web server root directory by running the following command:
sudo mv piwigo /var/www/html/
Set Permissions
Set the appropriate permissions for the Piwigo files and folders by running the following command:
sudo chmod -R 755 /var/www/html/piwigo/
sudo chown -R www-data:www-data /var/www/html/piwigo/
Step 3: Create a MySQL Database
Piwigo uses a MySQL database to store all the data. To create a MySQL database, follow the steps below.
Install MySQL Server
Install the MySQL server by running the following command:
sudo apt install mysql-server
Create a Database
Log in to your MySQL server as the root user by running the following command:
sudo mysql -u root -p
Enter the root password when asked.
Create a new database for Piwigo by running the following command:
CREATE DATABASE piwigo_db;
Create a new user with privileges to access the Piwigo database by running the following command:
CREATE USER 'piwigo_user'@'localhost' IDENTIFIED BY 'password';
Be sure to replace password with a strong password of your choice.
Grant the piwigo_user user privileges to access the piwigo_db database by running the following command:
GRANT ALL PRIVILEGES ON piwigo_db.* TO 'piwigo_user'@'localhost';
Flush the privileges by running the following command:
FLUSH PRIVILEGES;
Exit from the MySQL server by running the following command:
exit
Step 4: Access the Piwigo Installation Wizard
Finally, you can access the Piwigo installation wizard by accessing your Ubuntu Server IP address in your web browser:
http://ubuntu_server_ip_address/piwigo
The installation wizard will guide you through the installation process. When prompted, enter the following information:
- Database Name:
piwigo_db - Database Username:
piwigo_user - Database Password:
password(the password you chose in Step 3) - Database Host:
localhost - Table Prefix: (leave it as default)
Conclusion
Congratulations! You have successfully installed Piwigo on Ubuntu Server latest. You can now start uploading photos and creating galleries on your own photo gallery website.