Running Filerun Storage Sync Server in Docker Container

Posted on 129 views

A business may require a platform to house certain private files just like it is done on Google Drive. FileRun can do this.

FileRun is a safe, secure, and extendable Nextcloud compatible platform on which you can manage, share and sync files. It allows one to access files, share and sync files via WebDAV or connect to the Nextcloud mobile application.

Below are some of the cool features associated with FileRun:

  • Nextcloud compatible – you can sync files from your desktop using the Nextcloud desktop sync apps and also access them via the Nextcloud mobile app.
  • Metadata support – It automatically extracts and index information XMP, Exif, and IPTC, and therefore allowing one to search photos by keywords, author, dates e.t.c
  • Guest users support – allows you to collaborate with other people without creating accounts for them
  • Send file requests – with just a link, you collect and receive files from anyone right into your FileRun user account.
  • No import/scanning required – similarly to FTP, just point FileRun to where you keep the files on your server and you will get instant web access to them.
  • Native mobile apps – FileRun allows you can upload, browse and share files using compatible Android or iOS apps such as Nextcloud, WebDAV navigator, FE File explorer e.t.c
  • mobile support – you need to install nothing on your phone, just open FileRun in your mobile browser and it will automatically adapt to screens of any size to provide a smooth and intuitive experience.
  • Virtual drive – It gives one access to files directly from their computer, without impacting all of the disk space.

There are various plugins available for FileRun as explained below:

  • ONLYOFFICE – used to create, edit and preview Office files.
  • Google Docs Editor – Used to create and edit Office files.
  • Office Web View – for previewing Microsoft Office files.
  • Google Docs Viewer – Preview PDF and Office files.
  • Zoho Editor – can also be used to create, edit and preview Office files.
  • Office Web View – Preview Microsoft Office files.
  • Image editor – Crop, resize and rotate images you can also use it to adjust brightneess/contrast/saturation and more.
  • Autodesk – Preview CAD files.
  • Manipulate PDF documents – Merge multiple documents into one. Split documents and extract pages.

This guide aims to demonstrate how to run Filerun Storage Sync Server in Docker Container.

Getting Started.

Prepare your server for the installation by updating your system installing the required packages:

## On RHEL/CentOS/RockyLinux 8
sudo yum update
sudo yum install curl vim

## On Debian/Ubuntu
sudo apt update && sudo apt upgrade
sudo apt install curl vim

## On Fedora
sudo dnf update
sudo dnf -y install curl vim

Step 1 – Install Docker and Docker-Compose

Before we dive into the nub of this guide, you need to have both Docker and Docker-compose installed on your system.

Installing Docker on Linux can be achieved using the dedicated guide below.

Verify the installed docker version.

$ docker -v
Docker version 20.10.12, build e91ed57

Once docker is installed, install docker-compose using the below steps:

Download the docker-compose script.

curl -s https://api.github.com/repos/docker/compose/releases/latest | grep browser_download_url  | grep docker-compose-linux-x86_64 | cut -d '"' -f 4 | wget -qi -

Make the script executable and move it to your path.

chmod +x docker-compose-linux-x86_64
sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose

Add your system user to the docker group.

sudo usermod -aG docker $USER
newgrp docker

Check the installed version of Docker-Compose.

$ docker-compose version
Docker Compose version v2.2.3

You are also required to start and enable docker before proceeding.

sudo systemctl start docker && sudo systemctl enable docker

Step 2 – Provision the FileRun Container

Create a folder for FileRun as below.

sudo mkdir /filerun
sudo chmod 777 /filerun

Now in the directory, create a YAML file to be used to orchestrate the FileRun instance.

vim docker-compose.yml

In the file, add the lines below:

version: '2'

services:
  db:
    image: mariadb:10.1
    environment:
      MYSQL_ROOT_PASSWORD: StrongPassword
      MYSQL_USER: filerun_user
      MYSQL_PASSWORD: Passw0rd
      MYSQL_DATABASE: filerun
    volumes:
      - /filerun/db:/var/lib/mysql
  web:
    image: filerun/filerun
    environment:
      FR_DB_HOST: db
      FR_DB_PORT: 3306
      FR_DB_NAME: filerun
      FR_DB_USER: filerun_user
      FR_DB_PASS: Passw0rd
      APACHE_RUN_USER: www-data
      APACHE_RUN_USER_ID: 33
      APACHE_RUN_GROUP: www-data
      APACHE_RUN_GROUP_ID: 33
    depends_on:
      - db
    links:
      - db
      - tika
      - elasticsearch
    ports:
      - "80:80"
    volumes:
      - /filerun/html:/var/www/html
      - /filerun/user-files:/user-files
  tika:
    image: logicalspark/docker-tikaserver
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
    container_name: elasticsearch
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    mem_limit: 1g
    volumes:
      - /filerun/esearch:/usr/share/elasticsearch/data

In the above file, we have the following volumes:

  • /var/www/html – for FileRun application files
  • /filerun/user-files – For the FileRun user files
  • /var/lib/mysql – for the MariaDB data
  • /usr/share/elasticsearch/data for Elasticsearch index data

Create the required directories as below.

mkdir /filerun/html /filerun/user-files /filerun/esearch

Step 3 – Run the FileRun Docker Container

After configuring everything as above, we will start the container using docker-compose:

docker-compose up -d

Sample output:

[+] Running 1/44
 ⠹ db Pulling                                                                                                                          6.3s
   ⠦ 01bf7da0a88c Waiting                                                                                                              3.7s
   ⠦ f3b4a5f15c7a Waiting                                                                                                              3.7s
   ⠦ 57ffbe87baa1 Waiting                                                                                                              3.7s
   ⠦ 7ac3ea3a19e9 Waiting                                                                                                              3.7s
   ⠦ b89d9d23853d Waiting                                                                                                              3.7s
   ⠦ 6512bf94537d Waiting                                                                                                              3.7s
   ⠦ d75afd385b71 Waiting                                                                                                              3.7s
   ⠦ ab1935952eac Waiting                                                                                                              3.7s
   ⠦ 209bb6034896 Waiting                                                                                                              3.7s
   ⠦ aa325c613ddb Waiting                                                                                                              3.7s
   ⠦ 050a67aa09df Waiting                                                                                                              3.7s
   ⠦ bdb7d28d54b6 Waiting                                                                                                              3.7s
   ⠦ 0bc74f023b50 Waiting                                                                                                              3.7s
 ⠹ web Pulling                                                                                                                         6.3s
   ⠙ 72a69066d2fe Downloading [==============================================>    ]  25.13MB/27.15MB                                   4.1s
.....
[+] Running 5/5
 ⠿ Network filerun_default   Created                                                                                                   0.2s
 ⠿ Container filerun-db-1    Started                                                                                                   4.0s
 ⠿ Container filerun-tika-1  Started                                                                                                   3.5s
 ⠿ Container elasticsearch   Started                                                                                                   4.1s
 ⠿ Container filerun-web-1   Started                                                                                                   4.1s

Once everything has been pulled and started, check the status of the containers:

$ docker ps
CONTAINER ID   IMAGE                            COMMAND                  CREATED          STATUS          PORTS                               NAMES
be8d409b9c53   filerun/filerun                  "/filerun/entrypoint…"   29 seconds ago   Up 25 seconds   0.0.0.0:80->80/tcp, :::80->80/tcp   filerun-web-1
f9ff8b92c3c3   mariadb:10.1                     "docker-entrypoint.s…"   31 seconds ago   Up 27 seconds   3306/tcp                            filerun-db-1
af1054a0268e   logicalspark/docker-tikaserver   "/bin/sh -c 'exec ja…"   31 seconds ago   Up 27 seconds   9998/tcp                            filerun-tika-1

From the output above, we have the FileRun container exposed on port 80, we also have the MariaDB and Tika containers running.

Step 4 – Setup the cron indexing process

Using the FileRun container ID, open a console inside the container as below.

docker exec -it be8d409b9c53 bash

Remember to replace the container ID with your own container ID for FileRun. Once in the container console run the command:

vim /var/www/html/cron/process_search_index_queue.sh

Add the below lines to the opened file.

php /var/www/html/cron/process_search_index_queue.php

Save the file and assign the required permissions:

chmod 755 /var/www/html/cron/process_search_index_queue.sh

Also, open a crontab.

vim /etc/crontab

Add the line below leaving an empty line below it.

* * * * * root /var/www/html/cron/process_search_index_queue.sh

At this point, you should have FileRun automatically indexed inside Elasticsearch. The cronjob will run once every minute.

Step 5 – Access the FileRun Web UI

The FileRun server has been exposed on port 80 and can be accessed using the URL http://IP_Address

Running-Filerun-Storage-Sync-Server-in-Docker-Container

Click Next to go to the requirements check page.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-1

With all the requirements met, proceed to configure the database.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-2

With the correct details provided, click next. You will be provided with a username and password.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-3

Use the given credentials to log in to the FileRun dashboard.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-4-1

On successful authentication, you will see the FileRun dashboard.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-5-1024x500

Here, you can add new files/folders to your server.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-6

The added files will appear as below.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-7

Change your password under Superuser->account settings

Running-Filerun-Storage-Sync-Server-in-Docker-Container-8

You can also make further configurations such as admin users, roles, groups, plugin setup, user interface e.t.c under the control panel tab.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-9

Enable API under the API settings tab.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-10

Step 6 – File sync using Desktop Client

To sync files on FileRun with the client, you need the Nextcloud app installed on a client machine.

This can be achieved by downloading and installing the app from the links below.

You can also install the Desktop Client using system package providers

  • On Debian/Ubuntu
sudo add-apt-repository ppa:nextcloud-devs/client
sudo apt-get update

Install the Nextcloud desktop app from the PPA.

sudo apt install nextcloud-desktop
  • On CentOS/RHEL/Rocky Linux/Alma Linux
sudo yum -y install epel-release
sudo yum -y install nextcloud-client

Once installed, launch the app.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-11

Login to the FileRun server.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-12

Provide the FileRun server URL.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-13

You will be redirected to a web page where you need to provide login details for the FileRun user.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-14-1024x460

Accept Nextcloud to access FileRun using the user.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-15

Once everything is okay, you will see this message.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-16

Now close the web page and proceed to the Nextcloud connection wizard. Here, choose what to sync you can also sync everything in the local folder.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-17

With the connection established, you will see this window pop up.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-19

Click resume sync for all to sync everything.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-20

Now proceed and access the mounted Nextcloud path. Here, the files created in FileRun will be in the @Home directory. Create a new folder here say downloads

Running-Filerun-Storage-Sync-Server-in-Docker-Container-21-1

Back to the FileRun server, the folder should appear.

Running-Filerun-Storage-Sync-Server-in-Docker-Container-22

Closing Thoughts

Voila!

We have triumphantly gone through how to run the Filerun Storage Sync Server in Docker Container. Now you can access, create and edit your files using Filerun via the web interface or the desktop sync app.

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.