How to Install Hub20 on Fedora Server Latest

Hub20 is an open-source cloud storage solution designed for individuals and businesses. It offers secure cloud storage, file sharing, collaboration, and synchronization. This tutorial will guide you on how to install Hub20 on your Fedora Server latest using command-line interface (CLI).

Prerequisites

Before you install Hub20 on your Fedora Server latest, ensure that you have the following:

Installing Required Dependencies

To install Hub20 on your Fedora Server latest, you need to install the required dependencies. Run the following command on your terminal to install them:

sudo dnf install epel-release
sudo dnf update
sudo dnf install curl wget unzip git nginx-extras php php-fpm php-common php-cli php-curl php-json php-ldap php-mbstring php-mysqlnd php-xml php-zip php-gd php-imagick

Downloading and Installing Hub20

Once you have installed the required dependencies, download and install Hub20 by following these steps:

  1. Create a directory for Hub20:

    sudo mkdir -p /var/www/hub20
    
  2. Change the ownership of the /var/www/hub20 directory to NGINX user:

    sudo chown nginx:nginx /var/www/hub20/
    
  3. Move to the /var/www/hub20 directory:

    cd /var/www/hub20
    
  4. Clone the Hub20 repository from GitHub:

    sudo git clone https://github.com/hub20/hub20.git .
    
  5. Change the file permission of the following directories:

    sudo chmod 777 backend/web/assets/
    sudo chmod 777 frontend/web/assets/
    
  6. Install composer:

    sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
    
  7. Install required packages using composer:

    sudo composer install --prefer-dist --no-scripts --no-dev
    
  8. Rename the .env.example file to .env:

    sudo mv .env.example .env
    
  9. Generate the application key:

    sudo php artisan key:generate
    

Configuring Nginx for Hub20

To configure Nginx for Hub20, follow these steps:

  1. Create a server block configuration file for Hub20:

    sudo nano /etc/nginx/conf.d/hub20.conf
    
  2. Add the following contents into the file:

    upstream php-upstream {
        server unix:/run/php-fpm/www.sock;
    }
    
    server {
        listen 80;
        server_name example.com; # Replace example.com with your domain.
    
        root /var/www/hub20/frontend/web;
        index index.php;
    
        location / {
            try_files $uri $uri/ /index.php?$args;
        }
    
        location /admin {
            rewrite ^/admin(.*)$ /backend/web/$1;
        }
    
        location /backend {
            alias /var/www/hub20/backend/web/;
            rewrite ^(/backend)$ $1/ permanent;
            rewrite ^/backend/(.*)$ /$1 break;
    
            if (!-e $request_filename) {
                rewrite ^/backend/(.*)$ /backend/index.php?$1 last;
                break;
            }
        }
    
        location ~ \.php$ {
            set $path_info "";
    
            if ($uri ~ "^/backend(/.*)") {
                set $path_info $1;
            }
    
            fastcgi_pass php-upstream;
            fastcgi_index index.php;
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $path_info;
    
            fastcgi_param APPLICATION_ENV "production";
            fastcgi_param SERVER_NAME $server_name;
        }
    
        location ~ /\.(css|js|woff|woff2|eot|ttf|png|jpg|jpeg|gif|svg)$ {
            try_files $uri =404;
            access_log off;
            expires 30d;
            add_header Pragma public;
            add_header Cache-Control "public";
        }
    
        location /.well-known/acme-challenge/ {
            root /var/www/html;
        }
    
        location /robots.txt {
            add_header Content-Type text/plain;
            return 200 "User-agent: *\nDisallow: /\n";
        }
    }
    
  3. Test the Nginx configuration for syntax errors:

    sudo nginx -t
    
  4. Restart Nginx to load the new configuration:

    sudo systemctl restart nginx
    

Accessing Hub20

You can now access Hub20 from your web browser by using your domain. For example, if you used example.com in step 2 of configuring Nginx, you should access Hub20 by navigating to http://example.com in your web browser.

Conclusion

In this tutorial, you have learned how to install Hub20 on your Fedora Server latest. You can now start using Hub20 to store and share your files securely.

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!