Create a file named docker-compose.yml in your new directory. nano docker-compose.yml Use code with caution. Paste the following configuration into the file:
Maps port 8080 on your host machine to port 80 inside the container. You can change 8080 to any open port on your host.
define('APP_TITLE', 'My File Manager'); $root_path = $_SERVER['DOCUMENT_ROOT'] . '/data'; $root_url = 'data'; Use code with caution. Step 6: Launching and Verifying the Deployment
Pulls the official, production-ready TinyFileManager image from Docker Hub.
(like FileBrowser). Let me know what you'd like to explore next! Awesome Docker Compose Tiny File Manager - Awesome Docker Compose tinyfilemanager docker compose
Then run your docker-compose up command again.
Setting up Tiny File Manager with Docker Compose is a fast, secure way to manage your server files without installing heavy FTP software. The setup provides a persistent, easily accessible web interface for organizing your data. If you'd like, I can:
If you plan to expose TinyFileManager to the public internet, apply these production hardening strategies: 1. Enforce HTTPS via a Reverse Proxy
Running a file manager exposed to the web requires strict security protocols. TinyFileManager allows you to override its default settings by mounting a custom config.php . 1. Generating Secure Password Hashes Create a file named docker-compose
Open your web browser and navigate to:
Create a file named docker-compose.yml inside your project directory: nano docker-compose.yml Use code with caution. Paste the following configuration into the file:
: Keeps your application environment containerized, eliminating conflicts with existing host services.
services: tinyfilemanager: image: tinyfilemanager/tinyfilemanager:master restart: always ports: - "8080:80" volumes: - ./data:/var/www/html/data - ./config.php:/var/www/html/config.php You can change 8080 to any open port on your host
$auth_users = array( 'admin' => '$2y$10$YourGeneratedAdminHash...', 'user' => '$2y$10$YourGeneratedUserHash...' ); Use code with caution. Changing the Root Directory Path
Copy the resulting string (which begins with $2y$ ). Open your local config.php file, locate the $auth_users array, and replace the default hashes:
The default credentials are well-documented:
services: tinyfilemanager: image: tinyfilemanager/tinyfilemanager:latest container_name: tinyfilemanager ports: - "8080:80" volumes: - ./data:/var/www/html/data - ./config.php:/var/www/html/config.php restart: always Use code with caution. Understanding the Configuration
After this change, the service will only be accessible at http://localhost:8080 on the host machine.