Portainer Templates logo

Portainer Templates

Filerun Filerun

Stack

DocumentsNetwork OtherTools

access your files anywhere through self-hosted secure cloud storage, file backup and sharing for your photos, videos, files and more.

Configuration

Type
Compose
Source

Template by mediadepot·Source

Services

db

Configuration

Image
mariadb:10.1
Volumes
/var/lib/mysql : /opt/mediadepot/apps/filerun/db
Env vars
MYSQL_ROOT_PASSWORD=filerunrootMYSQL_USER=filerunMYSQL_PASSWORD=filerunMYSQL_DATABASE=filerun

Image details

Pulls: 3.2B
User: stackbrew
Created: Nov 25, 2014
Updated: 2 days ago
Status: active

app

Configuration

Image
afian/filerun
Ports
80
Volumes
/user-files/depot/tvshows : /media/storage/tvshows/user-files/depot/movies : /media/storage/movies/user-files/depot/music : /media/storage/music/user-files/depot/photos : /media/storage/photos/user-files/depot/ebooks : /media/storage/ebooks/user-files/depot/documents : /media/storage/documents/user-files/depot/downloads : /media/storage/downloads/user-files/depot/software : /media/storage/software/user-files/depot/blackhole : /media/temp/blackhole/user-files/depot/processing : /media/temp/processing/var/www/html : /opt/mediadepot/apps/filerun/web
Env vars
FR_DB_HOST=dbFR_DB_PORT=3306FR_DB_NAME=filerunFR_DB_USER=filerunFR_DB_PASS=filerunAPACHE_RUN_USER=www-dataAPACHE_RUN_USER_ID=15000APACHE_RUN_GROUP=www-dataAPACHE_RUN_GROUP_ID=15000
Restart
always

Standalone Install

Select an install method, to see config/commands for deploying Filerun

Installation method

Install on Portainer

Import all app templates into your Portainer instance, for easy 1-click deploys

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select Filerun, fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo
Original stackfile

The compose file this template deploys, straight from its repo:

version: '2'
# https://docs.filerun.com/docker
services:
  db:
    image: mariadb:10.1
    environment:
      MYSQL_ROOT_PASSWORD: filerunroot
      MYSQL_USER: filerun
      MYSQL_PASSWORD: filerun
      MYSQL_DATABASE: filerun
    volumes:
      - /opt/mediadepot/apps/filerun/db:/var/lib/mysql
    networks:
      - filerun

  app:
    restart: always
    image: afian/filerun
    ports:
     - "80"
    volumes:
    - /media/storage/tvshows:/user-files/depot/tvshows
    - /media/storage/movies:/user-files/depot/movies
    - /media/storage/music:/user-files/depot/music
    - /media/storage/photos:/user-files/depot/photos
    - /media/storage/ebooks:/user-files/depot/ebooks
    - /media/storage/documents:/user-files/depot/documents
    - /media/storage/downloads:/user-files/depot/downloads
    - /media/storage/software:/user-files/depot/software
    - /media/temp/blackhole:/user-files/depot/blackhole
    - /media/temp/processing:/user-files/depot/processing
    - /opt/mediadepot/apps/filerun/web:/var/www/html
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.filerun.loadbalancer.server.port=80"
      - "traefik.http.routers.filerun.rule=Host(`filerun.${DEPOT_DOMAIN_NAME}`)"
      - 'traefik.http.routers.filerun.entrypoints=websecure'
      - 'traefik.http.routers.filerun.tls.certresolver=mydnschallenge'
    environment:
      - FR_DB_HOST=db
      - FR_DB_PORT=3306
      - FR_DB_NAME=filerun
      - FR_DB_USER=filerun
      - FR_DB_PASS=filerun
      - APACHE_RUN_USER=www-data
      - APACHE_RUN_USER_ID=15000
      - APACHE_RUN_GROUP=www-data
      - APACHE_RUN_GROUP_ID=15000
    depends_on:
      - db
    links:
      - db:db
    networks:
      - traefik
      - filerun
networks:
  traefik:
    external: true
  filerun:

Or deploy it directly from the source:

git clone https://github.com/mediadepot/templates
cd templates
docker compose -f stacks/filerun/docker-compose.yml up -d

More install options in our documentation.

Container Documentation

db Documentation

MariaDB Server is a high performing open source relational database, forked from MySQL.

Serve Filerun on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.

Proxying filerun.example.com to http://app:80

Add this to your Caddyfile

filerun.example.com {
	reverse_proxy http://app:80
}

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs <container>
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Published on a random port

This template exposes 80 without setting a host port, so Docker picks a random free one on every deploy.

  • Find it in the Ports column of Portainer's container list, or with docker port <container>

Permission denied on volumes

If the logs show "permission denied", the app can't write to its data folder on the host.

  • Fix the ownership: sudo chown -R 1000:1000 /opt/mediadepot/apps/filerun/db (and the same for the other mapped folders)

Image won't pull

Test the pull directly on the host: docker pull mariadb:10.1

  • "manifest unknown" means the tag no longer exists.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Container keeps restarting

The always restart policy relaunches the app after every crash, so the real error can scroll past.

  • Check the logs right after a restart, the last few lines before it died are the useful ones.
  • Get the exit code with docker inspect <container> --format '{{.State.ExitCode}}'
  • Still stuck? Redeploy once with the restart policy set to no so the failure stays visible.

Stack won't deploy

Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.

  • YAML only accepts spaces for indentation, a single tab breaks the whole file.

Raise an issue

Found something which isn't working as it should? Here's how to report it.

A Compose stack

Filerun is a Compose stack, a set of containers (2 of them) defined in one file and brought up together by Portainer, then started and stopped as a single app.

The services

This stack is built from 2 containers that run side by side. Here's each one, with the image it runs and anything it waits for first:

  • db runs mariadb:10.1
  • app runs afian/filerun, starts after db

Ports

A port is the door the app answers on. Here the app exposes a port but leaves the host side blank, so Docker picks a free one for you. It opens:

  • 80, published on a random host port

Volumes

A volume is where Filerun keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:

  • /var/lib/mysql from /opt/mediadepot/apps/filerun/db on the host
  • /user-files/depot/tvshows from /media/storage/tvshows on the host
  • /user-files/depot/movies from /media/storage/movies on the host
  • /user-files/depot/music from /media/storage/music on the host
  • /user-files/depot/photos from /media/storage/photos on the host
  • /user-files/depot/ebooks from /media/storage/ebooks on the host
  • /user-files/depot/documents from /media/storage/documents on the host
  • /user-files/depot/downloads from /media/storage/downloads on the host
  • /user-files/depot/software from /media/storage/software on the host
  • /user-files/depot/blackhole from /media/temp/blackhole on the host
  • /user-files/depot/processing from /media/temp/processing on the host
  • /var/www/html from /opt/mediadepot/apps/filerun/web on the host

Environment variables

Environment variables are the settings you hand over when you deploy, things like a password or a timezone. Filerun takes 13 of them, all with defaults you can leave alone or tweak:

  • MYSQL_ROOT_PASSWORD, defaults to filerunroot
  • MYSQL_USER, defaults to filerun
  • MYSQL_PASSWORD, defaults to filerun
  • MYSQL_DATABASE, defaults to filerun
  • FR_DB_HOST, defaults to db
  • FR_DB_PORT, defaults to 3306
  • FR_DB_NAME, defaults to filerun
  • FR_DB_USER, defaults to filerun
  • FR_DB_PASS, defaults to filerun
  • APACHE_RUN_USER, defaults to www-data
  • APACHE_RUN_USER_ID, defaults to 15000
  • APACHE_RUN_GROUP, defaults to www-data
  • APACHE_RUN_GROUP_ID, defaults to 15000

Restart policy

The restart policy here is always, so Docker brings Filerun back up after a crash and again when the server reboots. Good for anything you want running around the clock. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).

Networking

Portainer puts these services on one shared private network, so they can find each other by name (like db) while only the ports above are open to you.

Portainer app templates

Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set Filerun up. Add the template list to Portainer once, then deploying Filerun is a click rather than a wall of config.