Instead of exposing TFM directly on port 8080, run it behind a reverse proxy with HTTPS. Here’s an extended docker-compose.yml with Nginx:
version: '3.8'services: tinyfilemanager: image: tinyfilemanager/tinyfilemanager:latest restart: unless-stopped volumes: - ./data:/var/www/html/data networks: - internal
nginx-proxy: image: nginx:alpine ports: - "443:443" volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro - ./ssl:/etc/nginx/ssl:ro depends_on: - tinyfilemanager networks: - internal tinyfilemanager docker compose
networks: internal: driver: bridge
Then configure nginx.conf to proxy requests to tinyfilemanager:80.
Let’s start with a minimal, working docker-compose.yml. We’ll use the official TinyFileManager Docker image (tinyfilemanager/tinyfilemanager:latest). Instead of exposing TFM directly on port 8080
This is the easiest way to get started. It uses the built-in SQLite database and maps a local folder for your files.
Click the Upload button in the toolbar. Select any file. It will appear in the file list, and also physically in ./data/ on your host. This confirms the volume mount works. Then configure nginx
server
listen 443 ssl;
server_name tfm.example.com;
ssl_certificate /etc/letsencrypt/live/tfm.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/tfm.example.com/privkey.pem;
location /
proxy_pass http://tinyfilemanager:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
TinyFileManager is even more powerful when combined with other containers.