services: tinyfilemanager: image: tinyfilemanager/tinyfilemanager:master restart: always labels: - "traefik.enable=true" - "traefik.http.routers.tinyfilemanager.rule=Host(`files.yourdomain.com`)" - "traefik.http.services.tinyfilemanager.loadbalancer.server.port=80" volumes: - ./data:/var/www/html/data networks: - traefik-network
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
The simplest way to deploy TinyFileManager with Docker Compose is to use a docker-compose.yml file that mounts a local directory for persistent storage. Create a project directory, and within it, create a file named docker-compose.yml . A minimal working example looks like this:
Then configure nginx.conf to proxy requests to tinyfilemanager:80 . tinyfilemanager docker compose
services: tinyfilemanager: image: tinyfilemanager/tinyfilemanager:master container_name: tinyfilemanager restart: always ports: - "8080:80" volumes: - ./data:/var/www/html/data - ./config.php:/var/www/html/config.php
docker-compose up -d
networks: web:
$auth_users = [ 'admin' => '$2y$10$axZWNo7Z..0z0mP9vCg9O.3pG8VwS5I05iJc.g4t0bI6pXh2uW6C.', // Default: admin@123 'user' => '$2y$10$p8/mK8L.w6Yc8Yg/gG6gO.d5lA2pXw3O5iJc.g4t0bI6pXh2uW6C.' // Default: user@123 ]; Use code with caution.
# Find your user ID id -u # Find your group ID id -g
location / proxy_pass http://tinyfilemanager:80; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; For instance, if you want to use an
A frequent point of friction in containerized environments is file permission mismatches between the host system and the container.
The official TinyFileManager image can be configured using environment variables to avoid editing configuration files directly. For instance, if you want to use an alternative community image that supports environment variables, your docker-compose.yml might look like this:
Always put it behind a reverse proxy with: proxy_set_header Host $host