How to Install HRCloud2 on Debian Latest

HRCloud2 is a personal cloud storage solution that allows you to store and access files from anywhere. In this tutorial, we will guide you on how to install HRCloud2 on Debian Latest.

Prerequisites

Before starting the installation process of HRCloud2, ensure that the following prerequisites are met:

Once you have verified these requirements, you can proceed with the installation.

Step 1: Install Required Dependencies

First, you need to install the following required dependencies:

$ sudo apt update
$ sudo apt install curl nginx mysql-server php7.3 php7.3-fpm php7.3-mysql

Step 2: Install and Configure Let's Encrypt SSL Certificate

To secure your HRCloud2 installation, it is recommended to install an SSL certificate. You can use Let's Encrypt to install the certificate.

$ sudo apt install certbot python3-certbot-nginx
$ sudo certbot --nginx

Choose your domain name and follow the instructions to complete the installation of an SSL certificate.

Step 3: Install HRCloud2 from GitHub

Next, you need to install HRCloud2 from GitHub.

$ git clone https://github.com/zelon88/HRCloud2.git
$ cd HRCloud2

Step 4: Configure the Database

Before setting up HRCloud2, you need to create a database for it. You can use the following MySQL command to create a new database:

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

Replace hrcloud2_db with your database name, hrcloud2_user with your username and <password> with a strong password.

Step 5: Configuring HRCloud2

Next, you need to configure HRCloud2 by editing the config.inc.php file:

$ cp config.inc.php.sample config.inc.php
$ nano config.inc.php

Set the following parameters to relevant values:

define("HR_DB_HOST", "localhost");
define("HR_DB_NAME", "hrcloud2_db");
define("HR_DB_USER", "hrcloud2_user");
define("HR_DB_PASS", "<password>");
define("HR_BASE_URL", "https://your-domain.com/hrcloud2");
define("HR_UPLOAD_DIR", "/var/www/hrcloud2/upload");
define("HR_DATA_DIR", "/var/www/hrcloud2/data");
define("HR_SSL_CERT", "/etc/letsencrypt/live/your-domain.com/fullchain.pem");
define("HR_SSL_KEY", "/etc/letsencrypt/live/your-domain.com/privkey.pem");

Replace <password> with the database password you set up in Step 4. Set the HR_BASE_URL to the domain name you own, and also set the HR_SSL_CERT and HR_SSL_KEY to the Let's Encrypt SSL certificate locations for your installation.

Step 6: Configuring NGINX

To configure NGINX, add a new server block to the /etc/nginx/sites-available/default file:

$ sudo nano /etc/nginx/sites-available/default

Add the following configuration:

server {
    listen 80;
    listen [::]:80;
    server_name your-domain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name your-domain.com;

    # SSL
    ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;

    # Root
    root /var/www/hrcloud2;
    index index.php;

    # Logs
    error_log /var/log/nginx/hrcloud2_error.log;
    access_log /var/log/nginx/hrcloud2_access.log;
    
    location / {
        try_files $uri /index.php?$query_string;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.3-fpm.sock;
    }
}

Replace your-domain.com with your actual domain name, and set the SSL certificate locations.

Step 7: Restart NGINX and PHP FPM

To apply all changes and make them effective, restart the NGINX web server and PHP-FPM service.

$ sudo systemctl restart nginx
$ sudo systemctl restart php7.3-fpm

Step 8: Access HRCloud2

Now you can access HRCloud2 by going to https://your-domain.com/hrcloud2 in your web browser.

Conclusion

In this tutorial, you learned how to install HRCloud2 on the Debian Latest operating system using Nginx and Let's Encrypt for SSL encryption. HRCloud2 provides an easy-to-use, scalable personal cloud storage solution that you can use to store and access files from anywhere.

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!