How To Install the Piwigo Photo Gallery on Ubuntu 14.04
Piwigo is a free, open-source, and customizable photo gallery software program distributed under the GNU General Public License (version 2).
In this guide, we will focus on getting Piwigo installed with the Apache web server on Ubuntu 14.04. At the end of this tutorial, you’ll have a working photo gallery with multiple albums. You can add pictures from a browser-based control panel, and let anyone view your gallery from the web.
Before you begin, please make sure you have these prerequisites.
- Ubuntu 14.04 Droplet
- Create a non-root user with sudo privileges. You can follow steps 1-4 in the Initial Server Setup with Ubuntu 14.04 guide
- You will also need a LAMP stack. If you don’t already have it installed you can follow the guide How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 14.04
Step 1 — Configure the Database
In this section we will create a database and MySQL user for Piwigo.
To get started, log in to MySQL with the root account you set up during the LAMP installation.
mysql -u root -p
The system will prompt you for a password. This will be the same MySQL root password used in the prerequisite LAMP guide.
Let’s create a database to be used for Piwigo. We’ll call it piwigo in this example.
CREATE DATABASE piwigo;
Next we need to create a database user and assign a password. You can use a different username than piwigouser if you want to, and you should definitely replace the
CREATE USER piwigouser@localhost IDENTIFIED BY 'password';
Grant the newly-created user permission to access the database:
GRANT ALL PRIVILEGES ON piwigo.* TO piwigouser@localhost;
Now set the new user and reload the privileges:
We can now exit out of MySQL:
Step 2 — Download Piwigo
Now we will download the latest version of Piwigo from the server.
curl -o piwigo.zip http://piwigo.org/download/dlcounter.php?code=latest
In order to extract the compressed files, you will need to install the “unzip” package:
sudo apt-get install unzip
Extract the Piwigo files from the zip file:
Step 3 — Copy Files to Document Root
Copy Piwigo’s files to Apache’s document root:
sudo rsync -avP ~/piwigo/ /var/www/html/
Alternately, you could set Piwigo up on a virtual host.
Step 4 — Install Dependencies
To allow Piwigo to add and create images, we will need to make sure the GD Graphics Library is installed:
sudo apt-get install php5-gd
Restart the web server:
sudo service apache2 restart
Step 5 — Complete Installation
Open a web browser and type in your domain name or IP address as the URL:
Note: If you see the default Apache page, you can remove it:
sudo rm /var/www/html/index.html
Refresh the page.
You will now be presented with the Piwigo installation page:
Fill out the requested information as explained below.
By default, the Host and Database tables prefix will be filled in automatically and can be left with the original settings.
You will need to enter the details for the following:
User: In our example, we will use piwigouser. This is the same as the database user that was created in Step 1
Password: This password is the new database password entered in Step 1
Database name: For this guide, we will use piwigo. This is the name of the MySQL database you created in Step 1
In this section, you can create a brand new username and password that will let you log in to the Piwigo control panel.
Username: Create a new username for the Piwigo website and to access the administration panel. For this guide, we will use “piwigo” as the username, but you can use your own
Password and Password [confirm]: Enter a password for your login, and once more to verify
Email address: Enter the email address you want to use as the site administrator
Options: Choose whether or not you want to Subscribe to Piwigo Announcements Newsletter and Send my connection settings by email – Both of the options are selected by default. You can choose not to receive the emails by unchecking the box for each
Once you filled everything out, click on the Start installation button. If everything was configured properly you will see a success message; otherwise, it will give you errors that will need to be corrected.
Now you can click the Visit the gallery button to access the control panel
Step 6 — Add Photos and View the Gallery
You’ll be prompted to Start the Tour. You have to click that button to get started. After that, you’ll be on the Piwigo home page.
You can click through the tour, or click the End tour button.
From the left menu, under Photos, click on Add.
Before you can add your first photo, you will need to click the create a new album link.
Under Album name, type in a name and then click on the Create button.
Click on the Add Photos button to select one or more image files. Alternately, you can drag and drop files into the browser. Once you’re done, click on the Start upload button.
To visit the gallery, click on the Visit the gallery link at the top of the page.
You can visit the gallery any time by visiting your IP address or domain in your browser.
To get back to the Piwigo control panel URL, you can visit
You now have a Piwigo photo gallery running on Ubuntu 14.04. To discover additional features of your gallery, you can launch live guides that will introduce you to different sections of the administration panel. From the main gallery view, you can access these guides by clicking on Administration, then Plugins, and then Take a Tour.