Install 4images Gallery on Ubuntu

4images-logo4images Gallery is an image gallery management system. It is written in PHP and uses MySQL database to store its data. 4images Gallery is free for private and non-commercial use. The installation of 4images Gallery is very easy and in this tutorial we will help you to install 4images Gallery on a Linux VPS running Ubuntu 14.04 as an operating system.

Before starting with the installation process, go ahead and connect to your server via SSH. Once you log in you can update all your system software to the latest version available. It is very important to keep all you software up to date and for that purpose you can use the following command:

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

Next, download the latest version of 4images Gallery from the official web site at and upload the zip archive to your server. Make sure that the zip archive is uploaded to the /var/www/ directory on your Ubuntu VPS. Once you upload the file you can continue with the other steps of this tutorial.

Navigate to the /var/www/ directory on your server using the command:

cd /var/www/

Next, extract the archive using the following command:

sudo unzip

If you get an error like the one below:

-bash: /usr/bin/unzip: No such file or directory

it means that the unzip package is not installed on your system. To install the unzip package you can use the command:

sudo apt-get install unzip

Then, extract the archive using the same command from above.
Change the ownership of the files:

sudo chown www-data: -R 4images/

Now, create an Apache virtual host for 4images Gallery:

sudo nano /etc/apache2/sites-available/4images.conf

Add the following content:

<VirtualHost *:80>
 DocumentRoot /var/www/4images
 <Directory /var/www/4images/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
 ErrorLog /var/log/httpd/
 CustomLog /var/log/httpd/ common

Save the file and close it. Enable 4images Gallery and restart the Apache web server:

sudo a2ensite 4images
sudo service apache2 restart

Now, create a MySQL database so 4images Gallery can store its data. Enter MySQL as root:

mysql -u root -p

To create a database, a user and set up a password you should enter the commands below, one by one:

mysql> CREATE DATABASE 4images;
mysql> GRANT ALL PRIVILEGES on 4images.* to '4images_user'@'localhost' identified by 'your_password';
mysql> exit

You can now continue with the online installation. Open your favorite web browser and enter your domain name into the search bar so you can access your 4images Gallery server. You should see something like the image below:


Fill out the requested fields and set up an admin account so you can manage your 4images Gallery installation later. Once you set up your account and the installation is successful you can log in to the admin panel 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 4images Gallery 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.

How to install Let’s Chat on an Ubuntu VPS
How to Install Jupyter on an Ubuntu 16.04 VPS
How to Install Collabtive 2.1 on an Ubuntu 14.04 VPS
There are currently no comments.