How to Install HomeGallery on Linux Mint Latest

HomeGallery is an open-source self-hosted photo gallery platform, that allows you to upload, organize, and share your pictures from your personal cloud or web server. In this tutorial, we will show you how to install HomeGallery on Linux Mint latest, step-by-step.

Prerequisites

Before you start installing, make sure to have the following,

Step 1 - Install required PHP extensions

HomeGallery requires some PHP extensions to be installed in your system. Run the following command to check if these extensions are already installed on your system.

sudo apt list --installed | grep php

The required PHP extensions are:

If any of these packages are not installed, use the following command to install them:

sudo apt install php7.2-mysqli php7.2-imagick php7.2-gd php7.2-xml php7.2-mbstring

Step 2 - Install and configure the database server

For the HomeGallery installation, you need a MySQL/MariaDB database server running on your system. To install MariaDB, use the following command:

sudo apt install mariadb-server

After installation, you need to secure your MariaDB installation by running the following command:

sudo mysql_secure_installation

You will be prompted with some questions, follow the on-screen instructions to complete the process.

Next, you create a new database and database user for HomeGallery to use. For example, to create a new database called homegallery and a new user called homegalleryuser with the password password, use the following command:

sudo mysql -u root -p
CREATE DATABASE homegallery;
CREATE USER 'homegalleryuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON homegallery.* TO 'homegalleryuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 3 - Configure Apache virtual host for HomeGallery

Next, you need to configure the Apache virtual host for HomeGallery. Create a new configuration file named homegallery.conf in the /etc/apache2/sites-available/ directory, and add the following configuration:

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

Then add the following content:

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/homegallery
    ServerName example.com
    ServerAlias www.example.com

    <Directory /var/www/homegallery/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

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

Save and close the file.

Next, activate the virtual host by running the following commands:

sudo a2ensite homegallery.conf
sudo service apache2 restart

Step 4 - Download and install HomeGallery

For the latest version, check the official HomeGallery website https://home-gallery.org/download/. After you download the tar file, run the following commands:

cd /tmp
wget https://github.com/photoprism/photoprism/releases/download/v0.7.2/homegallery-linux-amd64-0.7.2.tar.gz
tar xzvf homegallery-linux-amd64-0.7.2.tar.gz
sudo mv homegallery /var/www/homegallery

Make sure to replace homegallery-linux-amd64-0.7.2.tar.gz with the actual name of the tar file downloaded.

Step 5 - Configure HomeGallery

Now you need to configure HomeGallery by creating a config.yml file in the homegallery directory.

sudo nano /var/www/homegallery/config.yml

Then add the following content:

database:
  host: localhost
  port: 3306
  name: homegallery
  user: homegalleryuser
  password: password

photoprism:
  url: https://example.com
  storage: /var/www/homegallery/pictures
  thumbs: /var/www/homegallery/thumbs

auth:
  mode: internal
  users:
    admin:
      password: mypassword

security:
  tls: selfsigned
  password_cost: 11
  password_random: 21

Note that in your config.yml file, you should use your own values instead of those shown above.

Step 6 - Start HomeGallery

After completing the configuration process, you can start HomeGallery by running the following command:

cd /var/www/homegallery/
./homegallery -config config.yml

Then access HomeGallery via the URL http://example.com.

Conclusion

Congratulations! You have successfully installed HomeGallery on Linux Mint latest. You can now start uploading and organizing your photos on your own self-hosted photo gallery platform.

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!