How to install Zenphoto on Ubuntu 14.04

Zenphoto_logoZenphoto is a free and open souce, PHP based content management system (CMS) for creating gallery focused websites. Zenphoto features support for various media formats and integrated blog and custom pages. It is the ideal CMS for personal websites of artists, illustrators, photographers, designers, film makers and musicians. In this guide we will explain how to install Zenphoto on an Ubuntu 14.04 VPS.

At the time of writing this tutorial, Zenphoto 1.4.11 is the latest stable version available and it requires:

– Apache web server.
– PHP (version 5.2 or better) with GD graphics library and mbstring extension library.
– MySQL(version 5.0 or better) installed on your Linux VPS.


Login to your VPS via SSH

ssh user@vps_IP

Update the system

[user]$ sudo apt-get update && sudo apt-get -y upgrade

Install MySQL so you can create the database needed. Run the following command:

# apt-get install mysql-server mysql-client

Now run the post-installation script ‘mysql_secure_installation’ in order to set the MySQL root user password:

# mysql_secure_installation

- Set root password? [Y/n] y

- Remove anonymous users? [Y/n] y

- Disallow root login remotely? [Y/n] y

- Remove test database and access to it? [Y/n] y

- Reload privilege tables now? [Y/n] y

So, you set the MySQL root password to your liking. Next thing you need to do is to create a database. Login to your MySQL service as root:

[user]$ mysql -u root -p

mysql> CREATE DATABASE zenphoto;

mysql> GRANT ALL PRIVILEGES ON zenphoto.* TO 'zenphotouser'@'localhost' IDENTIFIED BY 'your-password';

mysql> \q

Do not forget to replace ‘your-password’ with a strong password.

Install Apache2 web server

[user]$ sudo apt-get install apache2

Install PHP and required PHP modules

To install the latest stable version of PHP and all necessary modules, run:

[user]$ sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-mysql php5-gd

Download and extract the latest version of Zenphoto on your server

[user]$ sudo cd /opt && wget
[user]$ sudo unzip
[user]$ sudo mv zenphoto-zenphoto-1.4.11/ /var/www/html/zenphoto/

All files have to be readable by the web server, so set the proper ownership:

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer

Now just $43 .99

[user]$ sudo chown www-data:www-data -R /var/www/html/zenphoto

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘zenphoto.conf’ on your virtual server:

[user]$ sudo touch /etc/apache2/sites-available/zenphoto.conf
[user]$ sudo ln -s /etc/apache2/sites-available/zenphoto.conf /etc/apache2/sites-enabled/zenphoto.conf
[user]$ sudo nano /etc/apache2/sites-available/zenphoto.conf

Then, add the following lines:

<VirtualHost *:80>
DocumentRoot /var/www/html/zenphoto/
<Directory /var/www/html/zenphoto/>
Options FollowSymLinks
AllowOverride All
ErrorLog /var/log/apache2/
CustomLog /var/log/apache2/ common

Restart the Apache web server for the changes to take effect:

[user]$ sudo service apache2 restart

Open your favorite web browser, navigate to and if you configured everything correctly the Zenphoto installer should be starting. You should follow the easy instructions on the install screen inserting the necessary information as requested.

Once you finish the installation you can access the admin section at:

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install ZenPhoto for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

2 thoughts on “How to install Zenphoto on Ubuntu 14.04”

  1. Thank you for the information but the syntax is incorrect for the mysql sequence. You will need to add the user zenphotouser before the granting of privileges and that statement does not need the IDENTIFIED BY clause.

    • The syntax is correct, it is a SQL syntax that creates and grants privileges to a user to access and manage the database. The IDENTIFIED BY is also needed to set the password for the user.


Leave a Comment