How to Install UberGallery on Ubuntu Server Latest

In this tutorial, we will guide you through the process of installing UberGallery on your Ubuntu server. UberGallery is a lightweight and easy-to-use PHP image gallery script that allows you to quickly and easily create beautiful web galleries for your website.

Prerequisites

Before installing UberGallery, you need to ensure that your server meets the following requirements:

Step 1: Download UberGallery

The first step is to download the latest version of UberGallery from the official website at ubergallery.net. You can choose the ZIP or TGZ archive, depending on your preference.

$ wget https://github.com/UberGallery/UberGallery/archive/master.zip

Step 2: Install required packages

UberGallery requires some PHP extensions to be installed on your server. You can install these extensions using the following command:

$ sudo apt-get install php5-gd php5-mysql

Step 3: Configure your web server

Next, you need to configure your web server to serve the UberGallery files. If you are using Apache web server, you can create an Apache virtual host for UberGallery as follows:

<VirtualHost *:80>
    ServerName yourdomain.com
    DocumentRoot /var/www/html/ubergallery/
    
    <Directory /var/www/html/ubergallery/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

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

If you are using Nginx web server, you can create an Nginx server block for UberGallery as follows:

server {
    listen 80;
    server_name yourdomain.com;
    root /var/www/html/ubergallery/;
    
    location / {
        try_files $uri $uri/ /index.php?$args;
    }
    
    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
    
    error_log /var/log/nginx/ubergallery_error.log;
    access_log /var/log/nginx/ubergallery_access.log;
}

Make sure to update the ServerName and root directives according to your server configuration.

Step 4: Create a MySQL database for UberGallery

UberGallery requires a MySQL or MariaDB database to store its configuration and gallery data. You can create a new database for UberGallery using the following command:

$ sudo mysql -u root -p
mysql> CREATE DATABASE ubergallery;
mysql> GRANT ALL PRIVILEGES ON ubergallery.* TO 'ubergalleryuser'@'localhost' IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;

Make sure to replace ubergalleryuser and password with your desired values.

Step 5: Install UberGallery

Once you have completed the above steps, you can now install UberGallery by following these steps:

  1. Extract the UberGallery ZIP or TGZ archive:
$ unzip master.zip
  1. Move the extracted directory to your web server root directory:
$ sudo mv UberGallery-master /var/www/html/ubergallery/
  1. Copy the default configuration file and update it with your database details:
$ cd /var/www/html/ubergallery/
$ cp ug-config-sample.php ug-config.php
$ nano ug-config.php
  1. Update the following parameters in the configuration file:

    • $config['database']['host'] - set it to localhost
    • $config['database']['user'] - set it to your MySQL user (ubergalleryuser in our example)
    • $config['database']['pass'] - set it to your MySQL password (also password in our example)
    • $config['database']['name'] - set it to your MySQL database (ubergallery in our example)
  2. Save and close the configuration file.

  3. Import the default database schema into your MySQL database:

$ sudo mysql -u ubergalleryuser -p ubergallery < /var/www/html/ubergallery/app/schema/ubergallery.sql
  1. Change the ownership of the content directory to www-data user:
$ sudo chown -R www-data: /var/www/html/ubergallery/content/

Step 6: Test your installation

You can now test your UberGallery installation by visiting your server's IP address or domain name in your web browser. You should see the default UberGallery page with some sample images.

Conclusion

Congratulations! You have successfully installed UberGallery on your Ubuntu server. You can now start creating beautiful web galleries for your website using UberGallery.

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!