HomeGallery is a free and open-source photo gallery software that can be easily installed on Debian. In this tutorial, we will guide you on how to install HomeGallery on Debian.
Before we proceed with the installation, ensure that the following prerequisites are met:
First, we need to install some required packages on our Debian system. Open a terminal and run the following command to update the package list:
sudo apt update
Next, install some required packages using the following command:
sudo apt install nginx mariadb-server mariadb-client php php-fpm php-mysql php-xml
This will install the Nginx web server, MariaDB database server, PHP, and some required PHP modules.
After installing the required packages, we need to configure the MariaDB database server. Run the following command to start the MariaDB service:
sudo systemctl start mariadb
Then, run the following command to secure the MariaDB installation and set the root password:
sudo mysql_secure_installation
Follow the on-screen instructions to set up the root password and other security options.
Next, create a new database and a new user for HomeGallery using the following commands:
sudo mysql -u root -p
This will open the MariaDB shell. Run the following commands to create a new database and a new user:
CREATE DATABASE homegallery;
CREATE USER 'homegalleryuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON homegallery.* TO 'homegalleryuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Replace password
with a strong password of your choice.
Download the latest version of HomeGallery using the following command:
wget https://github.com/tobiaseichert/homegallery/archive/v1.0.1.tar.gz
Extract the downloaded archive using the following command:
tar -zxvf v1.0.1.tar.gz
Then, move the extracted files to the Nginx web root directory using the following command:
sudo mv homegallery-1.0.1 /var/www/html/homegallery
Next, change the ownership of the HomeGallery directory to the Nginx user:
sudo chown -R www-data:www-data /var/www/html/homegallery
Create a new Nginx server block configuration file for HomeGallery using the following command:
sudo nano /etc/nginx/sites-available/homegallery.conf
Paste the following Nginx server block configuration:
server {
listen 80;
server_name your-domain.com;
root /var/www/html/homegallery;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
Replace your-domain.com
with your own domain name or IP address.
Save and close the file.
Then, enable the Nginx server block and restart the Nginx service using the following commands:
sudo ln -s /etc/nginx/sites-available/homegallery.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx
Switch to the HomeGallery installation directory and run the following command to install HomeGallery dependencies using Composer:
cd /var/www/html/homegallery
composer install
This will install all dependencies required by HomeGallery.
Copy the sample configuration file and rename it to config.yml
using the following command:
cp config.yml.dist config.yml
Then, open the config.yml
file using a text editor and edit the following lines:
# Database configuration
database:
username: homegalleryuser
password: password
database: homegallery
# Base URL
core:
baseUrl: http://your-domain.com
Replace password
with the password you set for the HomeGallery database user, and your-domain.com
with your own domain name or IP address.
Save and close the file.
Finally, run the following command to initialize the HomeGallery database:
php bin/cake.php migrations migrate
This will create the required database tables.
You have successfully installed HomeGallery on Debian Latest. Access HomeGallery by visiting http://your-domain.com
in a web browser. You can log in to the HomeGallery admin panel using the default username admin
and password admin
.
Congratulations! You have installed HomeGallery on Debian Latest.
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!