Installing FileRun with Portainer
Portainer is a web interface for Docker. This guide installs FileRun and its database as a stack in Portainer, with the same setup as the Docker installation guide, so that you can then start, watch and update FileRun from Portainer.
What you need
- A Linux server with Docker 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 Portainer.
On a Synology NAS, follow the Synology DSM guide instead, and on an Unraid server, the Unraid guides.
1. Install Portainer
Skip this step if Portainer already runs on the server.
Create the volume for the data of Portainer, and start its container:
1docker volume create portainer_data
2docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always \
3 -v /var/run/docker.sock:/var/run/docker.sock \
4 -v portainer_data:/data portainer/portainer-ce:lts
Open https://your-server:9443 in your browser. Portainer uses a certificate of its own, so the
browser shows a warning the first time.
-
Newer versions of Portainer first ask for a setup token. It is in the log of the Portainer container, on the line that starts with
setup_token=:1docker logs portainer -
Create the administrator account of Portainer. The password needs at least 12 characters.
-
Click Get Started. Portainer adds the Docker of the server as the environment
local.
For other systems and for the details, see Portainer's installation guide.
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.
3. Create the stack
-
In Portainer, open the environment
localand go to Stacks. -
Click Add stack and name the stack
filerun. -
Leave the build method on Web editor, and 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 -
Under Environment variables, 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.
-
Click Deploy the stack.
Portainer downloads the images and starts two containers, filerun-db-1 for the database and
filerun-web-1 for FileRun. On its first start, filerun-web-1 downloads FileRun into
/filerun/html. In Containers, the log of filerun-web-1 shows 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.
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.
To move to the newest image, open the stack filerun in Stacks, go to its Editor tab and
click Update the stack, with the option to pull the image again turned on. 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 tab, then click Update the stack.
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
Portainer does not deploy the stack, with 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, and open FileRun on that port.