How To Install FileRun on Synology DSM NAS using Web Station

Introduction

In this guide we will install FileRun on Synology DiskStation Manager (DSM), a Linux based software package that is the operating system for the DiskStation and RackStation NAS (Network Attached Storage) products.

Benefits of using FileRun over Synology's own apps:

  • lightweight and fast
  • no more waiting for indexing before being able to browse your photos, music or videos
  • mobile friendly without the need of an app (although a few are available)
  • high res thumbnails and previews
  • view and manage photos, music, videos, and documents. All within a single app.
  • and a lot more (check out http://www.filerun.com)

Note that this tutorial has been tested for now only with the Synology DS2415+ device, but should work fine with all DiskStation devices. If you are having troubles, drop us a message and we'll help you fast and free.

1. Install Web Station

This step is straightforward:

  1. Open up the Synology DSM in your browser.
  2. Open the Package Center app.
  3. Search for Web Station and install the found package.

2. Install PHP 7.0

Open the just installed Web Station package and click on the Management icon for the PHP 7.0 Back-end Package:

Web Station

This will open the Package Center and will offer you to install PHP 7.0. Complete the installation and close the Package Center.

Back on the Web Station you should now see PHP 7.0 marked as Installed.

Switch to the General Settings tab, select PHP 7.0 for PHP and click Apply:

3. Configure PHP

Switch to the PHP Settings tab. Using the PHP version drop down menu, select PHP 7.0.

Under Extensions, enable the following:

  • curl
  • exif
  • gd
  • mcrypt
  • openssl
  • pdo_mysql
  • zip

And click Apply.

Install the ionCube extension

ionCube is a PHP extension which is needed by FileRun to function.

For this step we will be using SSH. You might need to follow this guide to enable SSH access.

For connecting via SSH I will be using the PuTTY SSH client from a Windows computer.

Connect using PuTTY

Simply type in the hostname or IP address of your Synology device and click Open.
Using the command prompt, login as admin:

Connected

Change the current folder to /usr/local/lib/php70/modules:

cd /usr/local/lib/php70/modules  

Download ionCube:

sudo wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz  

Note that you might be asked to provide the admin password again for running these commands.

Extract the downloaded archive:

sudo tar xvfz ioncube_loaders_lin_x86-64.tar.gz  

Now open the PHP configuration file in a text editor:

sudo vim /usr/syno/etc/packages/WebStation/php70/conf.d/user_settings.ini  

Type : followed by i, this will allow you to paste inside the follow:

zend_extension = /usr/local/lib/php70/modules/ioncube/ioncube_loader_lin_7.0.so  

Simply right-click inside the console, to paste the text. The contents of the file should look like this:

user_settings.ini

To save the changes, press Esc, :, wq and Enter.

For the changes to take effect, open the Package Center, select PHP 7.0 and restart it by selecting Stop, wait for it to stop, and then Run.

Back on the SSH console.

To confirm that ionCube is loaded, create a file called info.php file in the root directory of your web server:

sudo vim /var/services/web/info.php  

Paste the following inside the file, then save and close it.

<?php  
phpinfo();  

After saving the changes to the file, visit http://<^>nas_ip_address<^>/info.php in your web browser. The web page you've opened should look something like this:

PHP Info

Note the "with the ionCube PHP Loader (enabled)" text at the bottom of the screenshot.

Important note

Making later changes to the PHP Settings using the Web Station control panel will remove the ionCube extension from the configuration file. You will then need to edit again the file /usr/syno/etc/packages/WebStation/php70/conf.d/user_settings.ini to add back the line which loads ionCube.

4. Install MariaDB

This is an easy step:

  1. Open the Package Center app.
  2. Search for MariaDB and install the found package.

Open MariaDB and click Change MariDB password to set a password. Make sure you write this password down.

MariaDB

5. Adding a MariaDB new user

If you don't have the phpMyAdmin package already installed, use this guide.

  1. Open phpMyAdmin and login as root with the password you set previously.
  2. Navigate to the User accounts tab and click Add user account
  3. Type in a User name. In the screenshot bellow the username filerun has been filled in.
  4. Select Local for the Host name.
  5. Type a Password of your choice and Re-type it.
  6. Make sure the Create database with same name and grant all privileges. option is checked.

Adding MariaDB user

Click the Go button at the bottom of the page to add the user account.

You can now close phpMyAdmin.

6. Install FileRun

Back to the SSH console.

You can install FileRun in the root folder of your webserver (/var/services/web/) or a subfolder of your choice.

cd /var/services/web/  

Download FileRun:

sudo wget -O FileRun.zip http://www.filerun.com/download-latest  

Unzip the downloaded archive:

sudo 7z x FileRun.zip  

Allow PHP to write temporary data:

sudo chown http:http -R system/data/  

From here you just have to follow the web-based installer, which will help you get FileRun running with just a few clicks.

Web-based installer

Open your browser and point it to http://YOUR-NAS-IP/

FileRun installer welcome screen

Click Next to proceed. Review the server requirements check and make sure there is no red error message:

FileRun server requirements check

Click Next to proceed with the database connection setup:

  • Type in the Database name. This is the same as what you used for the MariaDB username at the step 5 above (filerun in our example).
  • Type in the MySQL user: filerun (The same as above).
  • Type in the Password you have configured for the MariaDB user account.
  • Then click Next.

FileRun database connection setup

You will be presented with the following screen, letting you know that FileRun has been successfully installed:

FileRun successfull installation

Imortant: Make sure you made a copy of the username and password displayed on the screen, before proceeding. The password is being randomly generated at this step. Do not use the password from this tutorial screenshot, it won't work on your install.

Click Next to open FileRun. You should see the login page:

FileRun login page

The form should be prefilled so you can just hit Sign in.

7. Managing existing files

By default, PHP's access is limited by the open_basedir configuration directive to the following folders:

  • /tmp
  • /var/services/tmp
  • /var/services/web
  • /var/services/homes

In most cases your existing files would not be located under these paths. For example, pictures are usually located in the /photo folder, or something like /volume2/photo, if it was moved to a different volume.

To add /photo to the list of folders PHP can access, edit the PHP configuration file:

sudo vim /usr/syno/etc/packages/WebStation/php70/conf.d/user_settings.ini  

and make sure the following is configured like this:

open_basedir = /tmp:/var/services/tmp:/var/services/web:/var/services/homes:/photo  

Note the /photo path at the end. You can add multiple paths, separated by :.

For the changes to take effect, open the Package Center, select PHP 7.0 and restart it by selecting Stop, wait for it to stop, and then Run.

Now you can configure your FileRun user accounts to manage your existing photos:

Managing existing photos

8. Tweaking FileRun's configuration

One of the first things you would wish to enable inside FileRun's configuration is ImageMagick and FFmpeg.
These are server components which gives FileRun the capability of handling a large variety of image and video files, to provide you with quick image previews and thumbnails.

  1. Login to FileRun, open the Control panel.
  2. Select Image Preview from the menu.
  3. Check the "Enable ImageMagick support" option.
  4. Update the ImageMagick convert binary path to /bin/convert.
  5. Check the "Enable FFmpeg support" option.
  6. Update the FFmpeg binary path to /bin/ffmpeg

Click Save Changes and you're done!

Enable the mobile apps and the desktop sync

You might also want to enable the API, so that you can use the mobile and desktop sync apps with your NAS. You do that like this:

  1. Login to FileRun via HTTPS
  2. Open the Control Panel
  3. Select API (OAuth2) from the menu
  4. Check the Enable OAuth2 option and click Save Changes

You should now be able to connect to your FileRun using the mobile and desktop apps.

9. Notes

In future FileRun versions, support for NGINX X-Accel feature will be added. To enable that inside Synology, one will need to:

sudo vim /volume/@appstore/WebStation/misc/nginx_default_server.mustache  

and add something like this:

location /volume {  
    internal;
    root /;
}

The restart NGINX like this:

sudo synoservicecfg --restart nginx  

Now FileRun will be able to provide file downloads in a more efficient manner.

10. Conclusion

You have now successfully installed FileRun on a Synology NAS server. It's time to upload your files, photos, music or work documents and start sharing.

For more information on FileRun features and settings, visit http://docs.filerun.com