How to Install HomeGallery on Void Linux

HomeGallery is a free and open-source photo gallery software that allows you to store, organize and share your photos on your own server. It is written in PHP and uses MySQL or SQLite as its database backend. In this tutorial, we will show you how to install HomeGallery on Void Linux.

Prerequisites

Before we begin, make sure your system is up-to-date with the latest updates:

sudo xbps-install -Suy

Install Required Packages

First, we need to install the required packages to set up HomeGallery. Run the following command to install the web server stack and other dependencies:

sudo xbps-install -Sy nginx php php-fpm php-pdo php-mysqli php-gd php-exif php-gettext

Download HomeGallery

You can download the latest version of HomeGallery from their official website at https://home-gallery.org. Once you have downloaded it, extract the archive to your web server root directory:

sudo tar -xf homegallery-X.X.X.tar.gz -C /var/www/htdocs/

Configure Nginx for HomeGallery

Next, we need to configure Nginx for HomeGallery. Create a new server block file /etc/nginx/conf.d/homegallery.conf with the following content:

server {
    listen 80;
    server_name example.com;
    
    root /var/www/htdocs/homegallery;
    index index.php;
    
    location / {
        try_files $uri $uri/ /index.php?$args;
    }
    
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors on;
    }
}

Replace the server_name example.com with your domain name or IP address. Save and close the file.

Configure HomeGallery

Open the HomeGallery configuration file /var/www/htdocs/homegallery/config/config.sample.php and set your MySQL or SQLite details. Save it as /var/www/htdocs/homegallery/config/config.php.

Start Services

Now, start the Nginx and PHP-FPM services and enable them to start at boot time:

sudo ln -s /etc/sv/nginx /var/service/
sudo ln -s /etc/sv/php-fpm /var/service/

Configure Firewall

If you have a firewall enabled, you must allow HTTP traffic to Nginx:

sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT

Verify HomeGallery

Open your web browser and visit http://your-domain.com, and you will see the HomeGallery web interface. Log in to your account and start uploading your photos.

Conclusion

Now you have successfully installed HomeGallery on your Void Linux server. You can further customize and enhance your installation to meet your specific needs. Happy photo-sharing!

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!