Installing FileRun with Dockhand
Dockhand is a web interface for Docker. This guide installs FileRun and its database as a stack in Dockhand, with the same setup as the Docker installation guide, so that you can then start, watch and update FileRun from Dockhand. Everything it uses is part of the free edition of Dockhand.
What you need
- A Linux server with Docker 20.10 or later installed. See https://docs.docker.com/engine/install/.
- A shell on the server, as root or with
sudo, to create the folders of FileRun and, if it is not installed yet, to install Dockhand.
On a Synology NAS, follow the Synology DSM guide instead, and on an Unraid server, the Unraid guides.
1. Install Dockhand
Skip this step if Dockhand already runs on the server.
Start the Dockhand container. Its data, the stacks included, is kept in the volume dockhand_data:
1docker run -d --name dockhand --restart unless-stopped -p 3000:3000 \
2 -v /var/run/docker.sock:/var/run/docker.sock \
3 -v dockhand_data:/app/data fnsys/dockhand:latest
Open http://your-server:3000 in your browser.
Warning
Dockhand starts with its authentication turned off. Until you turn it on, anyone who can open the port 3000 of the server controls its Docker, and through it the whole server. Turn it on right away, and keep the port 3000 out of reach of the internet, behind a firewall or a VPN.
- In Settings → Authentication, open the Users tab and click Add user. Enter a username and a password, and click Create user.
- Turn on the Authentication switch, then sign in with that username and password.
- If Settings → Environments does not list the Docker of the server yet, click Add
environment, name it
local, choose Unix socket and click Add.
In the free edition, every user of Dockhand can do everything in it, so add only the people you trust with the whole server.
For other systems and for the details, see Dockhand's manual.
2. Create the folders
FileRun keeps its application files, the files of the users and its database in folders of the server, so that they stay when the containers are recreated. Create them:
1mkdir -p /filerun/html /filerun/user-files /filerun/db
2chown 1001:1001 /filerun/html /filerun/user-files
/filerun/htmlholds the FileRun application files. The FileRun container downloads them into it when it first starts./filerun/user-filesholds the files of the users. A folder that already has files in it works too, as long as the user1001can read and write them./filerun/dbholds the database. The database container makes it its own.
The FileRun container runs as the user and the group with the ID 1001, which is why the first two
folders must belong to them. A folder that does not exist when the stack is deployed is created by
Docker for the root user, and FileRun does not start (see Troubleshooting).
You can use other paths, such as folders on a data disk. Use the same paths in the stack, and keep
them absolute: Dockhand runs the stack from a folder of its own, so a path such as ./db would not
point where you expect.
3. Create the stack
-
In Dockhand, go to Stacks and click Create stack.
-
Name the stack
filerun. -
Paste the following into the editor:
1services: 2 db: 3 image: mariadb:12.2 4 restart: unless-stopped 5 environment: 6 MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} 7 MYSQL_USER: filerun 8 MYSQL_PASSWORD: ${DB_PASSWORD} 9 MYSQL_DATABASE: filerun 10 MARIADB_AUTO_UPGRADE: 1 11 TZ: ${TZ} 12 volumes: 13 - /filerun/db:/var/lib/mysql 14 web: 15 image: filerun/filerun 16 restart: unless-stopped 17 user: "1001:1001" 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: ${DB_PASSWORD} 24 TZ: ${TZ} 25 depends_on: 26 - db 27 ports: 28 - "8080:80" 29 volumes: 30 - /filerun/html:/var/www/html 31 - /filerun/user-files:/user-files -
In the panel of the environment variables, on the right, add these three variables:
DB_PASSWORD: the password of the database userfilerun. The stack gives it to both containers.DB_ROOT_PASSWORD: the password of the root user of the database.TZ: your time zone, such asEurope/London. See Setting the time zone.
-
Check Deploy immediately and click Create.
Dockhand downloads the images and starts two containers, filerun-db-1 for the database and
filerun-web-1 for FileRun, and shows the progress in a console under the editor. On its first
start, filerun-web-1 downloads FileRun into /filerun/html. In Containers, the Logs of
filerun-web-1 show when it is done:
1Open this server in your browser to complete the FileRun installation.
About the stack:
"8080:80"makes FileRun answer on port8080of the server. To use another port, change the first number only.restart: unless-stoppedstarts the containers again when the server restarts.- The database is created with the passwords of its first start. Changing
DB_PASSWORDorDB_ROOT_PASSWORDlater does not change the passwords of the existing database. - Dockhand writes the variables into the
.envfile of the stack, in its volumedockhand_data, where anyone with access to the volume can read them. To keep a password out of that file, click the key icon beside it: Dockhand then keeps it encrypted in its own database and never shows it again. Either way, the stack and its passwords are kept in the volumedockhand_data, so back it up too. See Dockhand's manual.
4. Complete the installation
Open http://your-server:8080 in your browser, and follow the steps of the FileRun installer.
- The database connection is filled in from the stack: the server
db, the port3306, the databasefilerunand, with Use stored credentials, the userfilerunand its password. - With Use root credentials checked, type the value of
DB_ROOT_PASSWORDin Database root password. You can also uncheck it, since the userfilerunhas 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
/filerun/user-files of the server.
Then secure your installation.
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. Check for updates, in Stacks, shows whether a newer image is available.
To move to the newest image, open the stack filerun in Stacks, check Pull images in the
menu beside Save & redeploy, and click Save & redeploy. The application files, the files of
the users and the database stay in their folders.
Next steps
- Adding SSL, to open FileRun with HTTPS through Caddy, Nginx Proxy Manager or Traefik, added to the stack.
- Full-text search: add the
tikaandelasticsearchservices to the stack in its editor, then click Save & redeploy.
Troubleshooting
FileRun does not start
The log of filerun-web-1 shows:
1ERROR: /var/www/html is not writable by the container user (1001:1001).
The folder of the application files does not belong to the user 1001. Give both folders to it:
1chown 1001:1001 /filerun/html /filerun/user-files
Then restart filerun-web-1 from Containers.
The port is already in use
The stack does not start, and the last line of the console under the editor shows a message such
as Bind for 0.0.0.0:8080 failed: port is already allocated. Another program uses the port 8080 of
the server. Change the first number of "8080:80" to a free port, click Save & redeploy, and
open FileRun on that port.
Dockhand cannot connect to Docker
Adding the environment local fails with "permission denied": the Dockhand container is not
allowed to use the Docker socket of the server. See
Docker socket permissions in Dockhand's
manual.