Exposing a file manager over plain HTTP is dangerous. Anyone on your network can sniff credentials, and browsers will mark your site as insecure. Let's integrate a reverse proxy.
Here is an advanced docker-compose.yml that includes Traefik (a modern reverse proxy) and automatic Let's Encrypt SSL.
version: '3.8'
services:
tinyfilemanager:
image: tinyfilemanager/tinyfilemanager:latest
container_name: tinyfilemanager
volumes:
- /srv/data:/var/www/html/data
- tinyfilemanager_config:/var/www/html/config
environment:
- TFM_USERNAME=$TFM_USER
- TFM_PASSWORD=$TFM_PASS
labels:
- "traefik.enable=true"
- "traefik.http.routers.tfm.rule=Host(files.yourdomain.com)"
- "traefik.http.routers.tfm.entrypoints=websecure"
- "traefik.http.routers.tfm.tls.certresolver=letsencrypt"
- "traefik.http.services.tfm.loadbalancer.server.port=80"
restart: unless-stopped
networks:
- traefik_public
Always put it behind a reverse proxy with:
Cause: The container user (www-data) cannot write to the mounted host directory.
Solution:
sudo chown -R 82:82 ./data
sudo chmod -R 755 ./data
Streamlining Your Server: Deploying TinyFileManager with Docker Compose
If you’ve ever needed a quick, lightweight way to manage server files through a web browser without the bloat of a full-blown OS, TinyFileManager is your answer. It’s a single-file PHP application that packs a punch with features like a built-in code editor, multi-user support, and direct file uploads.
Deploying it via Docker Compose is the most efficient way to keep your environment clean and your configuration portable. Here is how to get it running in minutes. Why TinyFileManager?
TinyFileManager is ideal for home labs or small web servers because it is: Ultralight: Runs on PHP 5.5+ and uses minimal resources.
Feature-Rich: Includes the Cloud9 IDE for editing 150+ languages directly in-browser. tinyfilemanager docker compose
Secure: Supports encrypted passwords, session-based access, and IP whitelisting. Responsive: Works perfectly on mobile and touch devices. The Docker Compose Setup
Using Docker Compose avoids long, messy docker run commands and ensures your file storage persists even if you update the container. 1. Create Your Project Directory First, set up a dedicated folder for your project. mkdir tinyfilemanager && cd tinyfilemanager Use code with caution. Copied to clipboard 2. Create the docker-compose.yml File
Create a file named docker-compose.yml and paste the following configuration:
services: tinyfilemanager: image: tinyfilemanager/tinyfilemanager:master container_name: tinyfilemanager restart: always ports: - "8080:80" volumes: # Map your host's data folder to the container's data path - ./data:/var/www/html/data # (Optional) Map a custom config file # - ./config.php:/var/www/html/config.php Use code with caution. Copied to clipboard
Deploy by Docker · prasathmani/tinyfilemanager Wiki - GitHub Exposing a file manager over plain HTTP is dangerous
I have provided two configurations:
The official image is based on Alpine Linux and comes with basic PHP modules. Need ZIP support for archives? Or git integration? Create your own Dockerfile:
FROM tinyfilemanager/tinyfilemanager:latest
USER root
RUN apk add --no-cache
zip
unzip
git
nano
| Image | Description |
|-------|-------------|
| tinyfilemanager/tinyfilemanager:master | Official image |
| ilteoood/tinyfilemanager:latest | Alpine-based |
| georgemoers/tinyfilemanager:latest | Extra features | The official image is based on Alpine Linux
version: '3.8'
services:
tinyfilemanager:
image: pritunl/tinyfilemanager:latest
container_name: tinyfilemanager
restart: always
ports:
- "127.0.0.1:8080:80"
volumes:
- ./storage:/var/www/html
- ./config.php:/var/www/html/config.php:ro
environment:
- USERNAME=$TFM_USER
- PASSWORD=$TFM_PASS
- TZ=$TZ
- MAX_UPLOAD_SIZE=$MAX_UPLOAD:-200M
deploy:
resources:
limits:
memory: 256M
reservations:
memory: 128M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 3