Image: iStock

Google Drive is the de-facto standard for so many people and even small businesses. But if you have either an on-premise data center (or just a spare Linux server on your LAN) or even a cloud-hosted service, and you’d like to have an alternative for certain documents and files, why not make use of FileRun?

FileRun is a Nextcloud compatible platform you can deploy as a localized Google Drive/Photos/Music. It’s extendable, safe, brandable and secure. With FileRun, you can share and sync files, access via WebDAV and even connect to it with the Nextcloud mobile app.

I’m going to walk you through the process of installing this platform.

SEE: Checklist: Server inventory (TechRepublic Premium)

What you’ll need

I’ll be demonstrating the installation on Ubuntu Server 20.04. To make this work you’ll need a running instance of Ubuntu Server and a user with sudo privileges. That’s it. Let’s get to work.

How to install the necessary dependencies

To start off, we’re going to install the dependencies. First, we’ll get the LAMP server up and running. Log into your server and install the full LAMP stack with:

sudo apt-get install lamp-server^ -y

When that installation completes, install the PHP modules with the command:

sudo apt-get install 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 -y

Next, we need to install the ionCube PHP loader. Download the latest version with the command:

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

Extract the file with:

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

Create a new ini file for Apache with:

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

In that file, paste the following:

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

Save and close the file. Create another ini file with:

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

In that file, paste the following:

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.

Reload Apache with:

sudo systemctl reload apache2

How to create the database

Next, we need to create a new database. Log in to the MySQL server with:

sudo mysql

Create the database:

CREATE DATABASE filerun;

Create a new user with:

CREATE USER filerun@localhost IDENTIFIED BY 'PASSWORD';

Where PASSWORD is a secure, unique password.

Grant the new user privileges to the database with:

GRANT ALL PRIVILEGES ON filerun.* TO filerun@localhost;

Flush the privileges and exit with:

FLUSH PRIVILEGES;
exit

How to create the Apache configuration

Let’s create an Apache configuration file with:

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

In that file, paste the following:


ServerName filerun.example.com
DocumentRoot /var/www//html/filerun

Options Indexes FollowSymLinks
AllowOverride All
Require all granted

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

Save and close the file.

Enable the rewrite module with:

sudo a2enmod rewrite

Enable the new virtual host with the command:

sudo a2ensite filerun.conf

Restart Apache with:

sudo systemctl restart apache2

How to download and unpack FileRun

Now, we’ll download and unpack FileRun. Back at the terminal window, download the latest version of FileRun with:

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

Create a new directory in the Apache document root with:

sudo mkdir /var/www/html/filerun

Unzip the file into the proper directory with:

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

Give the directory the proper permissions with:

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

How to complete the installation

Open a web browser and point it to http://SERVER/filerun (where SERVER is the IP address of the hosting server). You’ll be greeted by an easy-to-follow setup wizard. Click Next until you get to the database configuration screen (Figure A).

Figure A

The FileRun database configuration is short and sweet.

Fill in the database configuration with:

  • Database name: filerun
  • MySQL user: filerun
  • Password: the password you set in PASSWORD above

Continue clicking Next and you’ll be presented with the admin user credentials. The user will be superuser, and the password will be a randomly generated string of characters. Click the final Next and you’ll find yourself in the FileRun login screen. Once authenticated, you can start working to customize and start using FileRun (Figure B).

Figure B

The FileRun main window.

Click on the gear icon in the top right and you’ll enter the configuration window, where you can take care of numerous admin tasks (Figure C).

Figure C

The FileRun configuration window.

Congrats! You now have a fully functioning, private alternative to Google Drive/Photos/Music. FileRun should serve you and your small business well.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays