Installing FileRun on a Synology NAS
This guide installs FileRun on Synology DiskStation Manager (DSM) with Container Manager, as a
project that runs FileRun and its database from a docker-compose.yml file, the same way as the
Docker installation guide.
What you need
- DSM 7.2 or later, with the Container Manager package installed from the Package Center.
Container Manager replaced the Docker package of earlier DSM versions, and it creates the shared
folder
docker. - SSH access to the NAS, to look up two numbers in step 2. Turn it on under Control Panel → Terminal & SNMP → Enable SSH service.
1. Create a user for FileRun
The FileRun container runs as a user of the NAS, so that the permissions of DSM decide which folders FileRun can read and write.
- In Control Panel → User & Group, on the Group tab, create a group named
filerun. - On the User tab, create a user named
filerun, and make it a member of the groupfilerun.
The user does not sign in anywhere, so it needs no permissions on the DSM applications.
2. Find the IDs of the user and the group
Sign in to the NAS with SSH, and run:
1id filerun
The output looks like this:
1uid=1034(filerun) gid=100(users) groups=100(users),65537(filerun)
Here, the ID of the user filerun is 1034, and the ID of the group filerun is 65537. Note
your own numbers: they are not the same on every NAS.
3. Create the folders
In File Station, open the shared folder docker, create a folder named filerun in it, and
inside that one the folders html, user-files and db. Container Manager does not create the
folders of a project, and does not start it when one is missing.
htmlholds the FileRun application files. The FileRun container downloads them into it when it first starts.user-filesholds the files of the users.dbholds the database.
Give the group filerun the Read and Write permissions on html and on user-files: in
File Station, open the Properties of each folder, and add the group on the Permission
tab. FileRun does not start without them.
To open in FileRun files that are already on the NAS, such as those of a shared folder named
Files, use that shared folder in place of user-files in the project below, and give the group
filerun Read/Write access to it under Control Panel → Shared Folder → Edit →
Permissions.
4. Create the project
-
In Container Manager, go to Project and click Create.
-
Name the project
filerun, and set its path to the folderdocker/filerun. -
As the source, choose Create docker-compose.yml, and paste the following:
1services: 2 db: 3 image: mariadb:12.2 4 restart: unless-stopped 5 environment: 6 MARIADB_ROOT_PASSWORD: your_mysql_root_password 7 MYSQL_USER: filerun 8 MYSQL_PASSWORD: your_filerun_password 9 MYSQL_DATABASE: filerun 10 MARIADB_AUTO_UPGRADE: 1 11 TZ: Europe/London 12 volumes: 13 - /volume1/docker/filerun/db:/var/lib/mysql 14 web: 15 image: filerun/filerun 16 restart: unless-stopped 17 user: "1034:65537" 18 environment: 19 FR_DB_HOST: db 20 FR_DB_PORT: 3306 21 FR_DB_NAME: filerun 22 FR_DB_USER: filerun 23 FR_DB_PASS: your_filerun_password 24 TZ: Europe/London 25 depends_on: 26 - db 27 ports: 28 - "8080:80" 29 volumes: 30 - /volume1/docker/filerun/html:/var/www/html 31 - /volume1/docker/filerun/user-files:/user-files -
Before going on, change in the text:
1034:65537, inuser, to the IDs of the user and the groupfilerunfrom step 2.your_filerun_password, the password of the database userfilerun, written twice: inMYSQL_PASSWORDand inFR_DB_PASS.your_mysql_root_password, the password of the root user of the database.Europe/London, in bothTZ, to your time zone. See Setting the time zone./volume1, if the shared folderdockeris on another volume of the NAS, such as/volume2.
-
Finish the wizard. Container Manager downloads the images and starts the two containers,
filerun-db-1for the database andfilerun-web-1for FileRun.
"8080:80" makes FileRun answer on port 8080 of the NAS. DSM itself uses the ports 80 and 443,
so keep another one. To change it, change the first number only.
The database is created with the passwords of its first start. Changing them in the project later does not change the passwords of the existing database.
5. Complete the installation
On its first start, filerun-web-1 downloads FileRun into the folder html. Its log, in
Container Manager → Container, says when it is done:
1Open this server in your browser to complete the FileRun installation.
Open http://your-nas:8080 in your browser, and follow the steps of the FileRun installer.
- The database connection is filled in from the project: the server
db, the port3306, the databasefilerunand, with Use stored credentials, the userfilerunand its password. - With Use root credentials checked, type the root password of the database in Database root
password. You can also uncheck it, since the user
filerunhas every permission on its database. - The last step shows the username and the password of the superuser account. Keep them, then click Open FileRun and sign in.
The Docker image sets the home folder of the superuser to /user-files, which is the folder
docker/filerun/user-files of the NAS, or the shared folder you used in its place.
Then secure your installation.
HTTPS
DSM has a reverse proxy of its own, under Control Panel → Login Portal → Advanced →
Reverse Proxy, which can serve FileRun with HTTPS on a domain name, forwarding to localhost
on the port 8080. See Reverse proxies for what FileRun needs from a proxy.
Updating the image
FileRun itself is updated from its control panel (see Updating FileRun). The image provides the web server, PHP and the programs FileRun uses, and gets new releases of its own. To move to the newest image, sign in with SSH and run:
1cd /volume1/docker/filerun
2sudo docker compose pull
3sudo docker compose up -d
The application files, the files of the users and the database stay in their folders.
Troubleshooting
FileRun does not start
The log of filerun-web-1 shows:
1ERROR: /var/www/html is not writable by the container user (1034:65537).
The group filerun cannot write in the folder html. Check its permissions in File Station,
and that the numbers in the message are the IDs from step 2. Then start the project again.
The project does not start
A folder named in the project does not exist, or the port 8080 is used by another application of
the NAS. Create the missing folder, or change the first number of "8080:80".