Atlantic.Net Blog

How to Install Piwigo Photo Gallery on Ubuntu 20.04

Hitesh Jethva
by Atlantic.Net (468 posts) under VPS Hosting

Piwigo is a free, open-source, web-based photo gallery application that allows you to upload your photos and videos via FTP, web uploads, and desktop applications. It is written in PHP and uses MySQL as a database backend. Piwigo is especially useful for a photographer who wants to upload their photographs to the web and show them to their client. Piwigo allows you to customize per your needs using built-in extensions.

In this tutorial, we will show you how to install Piwigo Photo Gallery on Ubuntu 20.04.


  • A fresh Ubuntu 20.04 VPS on the Atlantic.Net Cloud Platform
  • A valid domain name pointed to your server IP
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Ubuntu 20.04 as the operating system, with at least 1GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your Ubuntu 20.04 server, run the following command to update your base system with the latest available packages.

apt-get update -y

Step 2 – Install LAMP Server

First, you will need to install the Apache web server, MariaDB, PHP and other PHP extensions to your server. You can install all of them with the following command:

apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-mbstring php-
xmlrpc php-gd php-xml php-intl php-mysql php-cli php php-ldap php-zip php-curl unzip git -y

Once all the packages are installed, edit the php.ini file and tweak some settings to recommended values:

nano /etc/php/7.4/apache2/php.ini

Change the following lines:

memory_limit = 256M
upload_max_filesize = 100M
date.timezone = America/Chicago

Save and close the file, then restart the Apache service to apply the configuration.

systemctl restart apache2

Step 3 – Create a Database for Piwigo

Piwigo uses MySQL or MariaDB as a database backend, so you will need to create a database and user for Piwigo.

First, log in to MySQL with the following command:


Once logged in, create a database and user with the following command:

CREATE USER 'piwigo'@'localhost' IDENTIFIED BY 'password';

Next, grant all the privileges to the piwigo database with the following command:

GRANT ALL ON piwigo.* TO 'piwigo'@'localhost' IDENTIFIED BY 'password' WITH GRANT 

Next, flush the privileges and exit from the MySQL shell with the following command:


Step 4 – Install Piwigo

First, download the latest version of Piwigo from their official website using the following command:

curl -o

Once the download is completed, unzip the downloaded file with the following command:


Next, move the extracted directory to the Apache web root directory:

mv piwigo /var/www/html/piwigo

Next, set proper permissions and ownership with the following command:

chown -R www-data:www-data /var/www/html/piwigo/
chmod -R 755 /var/www/html/piwigo/

Step 5 – Configure Apache for Piwigo

Next, you will need to create an Apache virtual host configuration file for Piwigo. You can create it with the following command:

nano /etc/apache2/sites-available/piwigo.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/piwigo

<Directory /var/www/html/piwigo/>
Options +FollowSymlinks
AllowOverride All
Require all granted

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


Save and close the file, then enable the Piwigo virtual host and Apache rewrite module with the following command:

a2ensite piwigo.conf
a2enmod rewrite

Finally, restart the Apache service using the following command:

systemctl restart apache2

Step 6 – Access Piwigo

Now, open your web browser and type the URL You will be redirected to the Piwigo setup page:

Provide your database details and admin user information and click on the Start installation button. Once the installation has been completed successfully, you should see the following page:

Now, click on the Visit the gallery. You should see the Piwigo dashboard in the following page:

From here, you can add your photo easily or click on “I will find my way by myself.” You should see the following page:


Congratulations! You have successfully installed and configured Piwigo photo gallery on Ubuntu 20.04. You can now upload your photos and access them over the Internet easily – give it a try with VPS hosting from Atlantic.Net!

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year

Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Best Cloud Consultancy or MSP in 2022
BAA Red Flags: What Should Your HIPAA-Compliant Hosting Company Be Willing to Accommodate?
HIPAA Compliance for Remote Workers: How to Maintain HIPAA Compliance with a Remote Team
How to Make the Best Use of the Cloud in the Internet of Things (IoT)
How to Make the Best Use of Artificial Intelligence in Cloud Computing

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year

New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2008 Lookout Dr,

Garland, Texas 75044

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4


London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom