Tinyfilemanager Docker Compose -
To use a custom config.php:
volumes:
- ./config.php:/var/www/html/config.php:ro
- ./data:/var/www/html/files
Example config.php:
<?php
$username = 'admin';
$password = '$2y$10$YourHashedPasswordHere';
$root_path = '/var/www/html/files';
$max_upload_size = 104857600;
To customize settings, create config/config.php:
<?php // Custom configuration $auth_users = array( 'admin' => '$2y$10$YourHashedPasswordHere', // Use password_hash() 'guest' => '$2y$10$GuestHashedPassword' );
$theme = 'bootstrap5'; $upload_max_size = 100 * 1024 * 1024; // 100MB
TinyFileManager is a single-file PHP script that provides a complete, web-based file management interface for your server
. Deploying it via Docker Compose simplifies dependency management and allows you to easily mount the host directories you wish to manage. 1. Prerequisites
Ensure you have Docker and Docker Compose installed on your host system. 2. Creating the Docker Compose Configuration Create a new directory for your project and add a docker-compose.yml file. This configuration uses the official tinyfilemanager/tinyfilemanager Docker Hub tinyfilemanager tinyfilemanager/tinyfilemanager container_name : tinyfilemanager
# Mount the folder you want to manage to /var/www/html/data inside the container /path/to/your/files :/var/www/html/data tinyfilemanager docker compose
# Optional: Mount a custom config.php if you need to override default settings # - ./config.php:/var/www/html/config.php Use code with caution. Copied to clipboard 3. Key Configuration Options
I have provided two configurations:
Logs are crucial for security auditing and debugging.
docker compose logs -f tinyfilemanager
Before we start, ensure you have the following: To use a custom config
Verify your installation:
docker --version
docker compose version
version: '3.8'services: tinyfilemanager: image: pritunl/tinyfilemanager:latest container_name: tinyfilemanager restart: unless-stopped expose: - "80" volumes: - ./data:/var/www/html environment: - USERNAME=admin - PASSWORD=admin123 networks: - proxy-network
nginx: image: nginx:alpine container_name: nginx-proxy restart: unless-stopped ports: - "80:80" - "443:443" volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro - ./ssl:/etc/nginx/ssl depends_on: - tinyfilemanager networks: - proxy-network
networks: proxy-network: driver: bridgeExample config
docker-compose logs -f