There is a new version of this tutorial available for Ubuntu 22.04 (Jammy Jellyfish).

How to Install FileRun on Ubuntu 20.04

FileRun is a free, open-source, self-hosted, and full-featured web-based file manager for Linux. It is very similar to Google Drive and allows you to manage your photo, movie, audio collection, or sharing files with your family and friends. It can install on any server including, cloud VPS, desktop PC, and Raspberry. It is written in PHP and uses MySQL/MariaDB as a database backend. If you are looking for a self-hosted file share and sync platform then FileRun is the best option for you.

In this post, we will show you how to install FileRun with Apache on Ubuntu 20.04.

Prerequisites

  • A server running Ubuntu 20.04.
  • A valid domain name pointed with your server IP.
  • A root password is configured on the server.

Install Apache, MariaDB, and PHP

First, install the Apache webserver, MariaDB database server, PHP and other required PHP extensions using the following command:

apt-get install apache2 mariadb-server php7.4 libapache2-mod-php7.4 imagemagick ffmpeg php-imagick php7.4-mysql php7.4-fpm php7.4-common php7.4-gd php7.4-json php7.4-curl php7.4-zip php7.4-xml php7.4-mbstring php7.4-bz2 php7.4-intl

Once all the packages are installed, verify the PHP version using the following command:

php -v

You will get the PHP version in the following output:

PHP 7.4.3 (cli) (built: Mar  2 2022 15:36:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

You will also need to install ioncube loader PHP extension to your server. First, download the ioncube loader with the following command:

wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Once the download is completed, extract the downloaded file to the PHP directory:

tar -xzf ioncube_loaders_lin_x86-64.tar.gz -C /usr/lib/php

Next, create a PHP configuration file with the following command:

nano /etc/php/7.4/apache2/conf.d/00-ioncube.ini

Add the path of your ioncube extension as shown below:

zend_extension = /usr/lib/php/ioncube/ioncube_loader_lin_7.4.so

Save and close the file then create another PHP file for FileRunfollowing command with the :

nano /etc/php/7.4/apache2/conf.d/filerun.ini

Add the following lines:

expose_php = Off
error_reporting = E_ALL & ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
ignore_repeated_errors = Off
allow_url_fopen = On
allow_url_include = Off
variables_order = "GPCS"
allow_webdav_methods = On
memory_limit = 128M
max_execution_time = 300
output_buffering = Off
output_handler = ""
zlib.output_compression = Off
zlib.output_handler = ""
safe_mode = Off
register_globals = Off
magic_quotes_gpc = Off
upload_max_filesize = 20M
post_max_size = 20M
enable_dl = Off
disable_functions = ""
disable_classes = ""
session.save_handler = files
session.use_cookies = 1
session.use_only_cookies = 1
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_httponly = 1
date.timezone = "UTC"

Save and close the file then restart the Apache service to apply the changes:

systemctl reload apache2

Once you are finished, you can proceed to the next step.

Create a Database for FileRun

Next, you will need to create a database and user for FileRun. First, log in to MariaDB with the following command:

mysql

Once you are connected, create a database and user with the following command:

MariaDB [(none)]> create database filerun;
MariaDB [(none)]> create user [email protected] identified by 'password';

Next, grant all the privileges to the FileRun database with the following command:

MariaDB [(none)]> grant all privileges on filerun.* to [email protected];

Next, flush the privileges and exit from the MariaDB shell with the following command:

MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

Once your database is created, you can proceed to the next step.

Download FileRun

First, you will need to download the latest version of FileRun from their official website. You can download it using the following command:

wget -O FileRun.zip https://filerun.com/download-latest

After the download is completed, create a directory for FileRun and extract the downloaded file inside this directory:

mkdir /var/www/html/filerun
unzip FileRun.zip -d /var/www/html/filerun

Next, change the ownership of the FileRun directory with the following command:

chown -R www-data:www-data /var/www/html/filerun

Once you are finished, you can proceed to the next step.

Create an Apache Virtual Host for FileRun

Next, you will need to create an Apache virtual host configuration file to host FileRun on the internet. You can create it using the following command:

nano /etc/apache2/sites-available/filerun.conf

Add the following lines:

<VirtualHost *:80>
        ServerName filerun.example.com

        DocumentRoot /var/www/html/filerun

        <Directory "/var/www/html/filerun">
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted
        </Directory>

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

Save and close the file when you are done. Then, activate the FileRun virtual host and enable the Apache rewrite module with the following command:

a2enmod rewrite
a2ensite filerun.conf

Finally, restart the Apache service to apply the configuration changes:

systemctl restart apache2

To check the status of the Apache, run the following command:

systemctl status apache2

You will get the following output:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-03-11 12:02:45 UTC; 9s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 21235 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 21256 (apache2)
      Tasks: 6 (limit: 4686)
     Memory: 15.1M
     CGroup: /system.slice/apache2.service
             ??21256 /usr/sbin/apache2 -k start
             ??21257 /usr/sbin/apache2 -k start
             ??21258 /usr/sbin/apache2 -k start
             ??21259 /usr/sbin/apache2 -k start
             ??21260 /usr/sbin/apache2 -k start
             ??21261 /usr/sbin/apache2 -k start

Mar 11 12:02:45 ubuntu systemd[1]: Starting The Apache HTTP Server...

Once you are done, you can proceed to access the FileRun.

Access FileRun Web Interface

At this point, FileRun is installed and configured with Apache. You can now access the FileRun web interface using the URL http://filerun.example.com. You should see the FileRun welcome page:

Click on the Next button. You should see the server requirements page:

Make sure all the required packages are installed then click on the Next button. You should see the database setup page:

Provide your database configuration information and click on the Next button. Once the installation has been completed, you should see the following page with login credentials:

Click on the Next button. You should see the FileRun login page:

Provide your login credential and click on the Sign in button. You should see the FileRun dashboard on the following page:

Click on the Control Panel in the left pane, you should see the FileRun control panel on the following page:

Conclusion

Congratulations! you have successfully installed the FileRun file sharing platform on Ubuntu 20.04. You can now add your files, pictures, and other documents to the FileRun and share them with your friends and family. Feel free to ask me if you have any questions.

Share this page:

Suggested articles

0 Comment(s)

Add comment