ypierre
By:
Peter
We hope you find this tutorial helpful. In addition to guides like this one, we provide simple cloud infrastructure for developers. Learn more →

How To Install the Piwigo Photo Gallery on Ubuntu 14.04

PostedDecember 18, 2014 27.1k views Applications Ubuntu

Introduction

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.

Prerequisites

Before you begin, please make sure you have these prerequisites.

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 password.

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:

FLUSH PRIVILEGES;

We can now exit out of MySQL:

exit

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:

unzip piwigo.zip

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: http://your-server-ip/.

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:

Piwigo Installation Page

Fill out the requested information as explained below.

Database configuration

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

Administration configuration

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.

Congratulations. Piwigo installation is completed

Now you can click the Visit the gallery button to access the control panel

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.

create a new album

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.

Add Photos

To visit the gallery, click on the Visit the gallery link at the top of the page.

Gallery home 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 http://your_server_ip/admin.php.

Conclusion

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.

2 Comments

Creative Commons License