How to Install Zenphoto on Ubuntu Server Latest

Zenphoto is a popular, open source web gallery software for photography lovers or creatives who want to manage their photographs, images, and videos on their own website.

In this tutorial, we will explain how to install Zenphoto on Ubuntu Server.

Prerequisites

Before proceeding with the installation steps, you need to ensure the following:

Step 1: Update the Package List

Once you have logged in to your Ubuntu Server, the very first task should be to update the package index and upgrade the system packages to their latest versions to ensure that all the existing packages are up to date, and there are no dependency issues.

sudo apt-get update
sudo apt-get upgrade -y

Step 2: Install Required Dependencies

Zenphoto has several dependencies such as PHP, MySQL, and Apache web server for proper functionality, and we need to install them before installing Zenphoto. You can install all these dependencies using the following command:

sudo apt-get install -y apache2 mysql-server php libapache2-mod-php php-mysql php-xml php-gd php-zip php-apcu php-mbstring unzip

Once the installation process is completed, you can verify the installed packages' versions using the following command:

php -v
mysql --version
apache2ctl -v

Step 3: Download Zenphoto

The next step is to download the Zenphoto package from the official Zenphoto website. You can download the latest Zenphoto version from the Zenphoto download page.

sudo wget https://www.zenphoto.org/temp/download/zenphoto_1.5.7.tar.gz

After downloading the package, we need to extract it:

sudo tar -zxvf zenphoto_1.5.7.tar.gz -C /var/www/html/

Step 4: Configure Zenphoto

Now, create a new MySQL database and user for Zenphoto using the following command:

sudo mysql -u root -p

When prompted, enter the root password and then run the following queries:

CREATE DATABASE zenphoto;
CREATE USER 'zenphoto'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON zenphoto.* TO 'zenphoto'@'localhost';
FLUSH PRIVILEGES;
EXIT;

You can replace the 'password' with your desired password.

Next, navigate to the zenphoto directory:

cd /var/www/html/zenphoto

Rename zp-config.php.new to zp-config.php:

sudo mv zp-config.php.new zp-config.php

Open the zp-config.php file using the following command:

sudo nano zp-config.php

Update the following fields with your environment details:

define('DB_HOST', 'localhost');
define('DB_USER', 'zenphoto');
define('DB_PASSWORD', 'password');
define('DB_NAME', 'zenphoto');

Finally, save and close the file by pressing CTRL+X, followed by Y, and then press Enter.

Step 5: Configure Apache

The next step is to configure the Apache webserver to serve the Zenphoto content.

Open the Apache configuration file using the following command:

sudo nano /etc/apache2/sites-available/zenphoto.conf

Add the following content and save the file.

<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/html/zenphoto
<Directory /var/www/html/zenphoto/>
Options +FollowSymLinks
AllowOverride all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/zenphoto_error.log
CustomLog ${APACHE_LOG_DIR}/zenphoto_access.log combined
</VirtualHost>

Note: Replace the "example.com" with your domain name.

Now, enable the new virtual host file and Apache modrewrite using the following commands:

sudo a2ensite zenphoto.conf
sudo a2enmod rewrite

Restart the Apache webserver to apply the changes using the following command:

sudo systemctl restart apache2

Step 6: Complete Zenphoto Setup

Type your domain name in the browser URL bar. You should be redirected to the Zenphoto setup wizard page. Follow the on-screen instructions to complete the Zenphoto setup by entering the requested details when prompted.

Once you complete the Zenphoto setup, you can log in to your site with the provided URL and admin credentials.

Conclusion

You have successfully installed Zenphoto on your Ubuntu Server, configured the MySQL database, Apache webserver, and completed the Zenphoto setup. Now, you can access it using the admin URL and start managing your photos, images, and videos.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!