Tinyfilemanager Docker Compose
Mastering TinyFile Manager with Docker Compose: The Ultimate Lightweight File Sharing Solution In the modern landscape of self-hosting and server management, the need for a simple, fast, and secure way to manage files via a web browser is universal. While massive ecosystems like Nextcloud or Seafile offer powerful features, they often come with heavy database backends, memory-hungry processes, and complex setups. Enter TinyFile Manager – a single, standalone PHP file that provides a sleek, responsive web interface to upload, download, edit, archive, and manage files on your server. When paired with Docker Compose , it becomes an unstoppable, portable, and reproducible solution. This article will serve as your complete guide to deploying TinyFile Manager using Docker Compose. We will cover everything: from basic setup and environment configuration to advanced use cases like SSL termination, persistent storage, and integration with existing reverse proxies.
Why TinyFile Manager? A Brief Overview Before diving into the YAML configurations, let's understand why this tool has garnered over 4,000 stars on GitHub.
Single File Architecture : Unlike WordPress or Nextcloud, TFMs codebase resides in one PHP file. This makes updates trivial (download a new file) and debugging straightforward. No Database Required : Everything is file-system based. What you see in the browser is exactly what is on your disk. Two-Factor Authentication (2FA) , upload/download restrictions, and external authentication hooks. Code Editor with syntax highlighting for over 100 languages, plus a built-in terminal (optional but powerful). Lightning Fast : Because there is no middleware or database layer, browsing directories feels instant.
However, manually installing PHP and configuring a webserver (Nginx/Apache) on your host system is fragile. This is where Docker Compose provides a superior alternative. tinyfilemanager docker compose
Why Docker Compose? The Case for Containerization Running docker run -d -p 8080:80 -v /home/user/data:/var/www/html tinyfilemanager/tinyfilemanager is fine for a quick test. But for a production-like, persistent, manageable setup, you need Docker Compose . Advantages of using Docker Compose:
Declarative Configuration : Your entire setup (volumes, networks, environment variables) lives in a single docker-compose.yml file. Reproducibility : Move your compose file to any server, run docker compose up -d , and your file manager is back online. Multi-container synergy : Easily add a MariaDB container (if you extend TFM), a Redis cache, or an Nginx reverse proxy sidecar. Easy Updates : Change the image tag and run docker compose up -d – zero manual file downloads.
Prerequisites Before we start, ensure you have the following: Mastering TinyFile Manager with Docker Compose: The Ultimate
A Linux/Windows/WSL or macOS server with Docker Engine 20.10+ and Docker Compose v2+ installed. Basic knowledge of navigating the terminal. (Optional) A domain name pointed to your server’s IP for HTTPS.
Verify your installation: docker --version docker compose version
Step 1: The Basic docker-compose.yml for TinyFile Manager Let's start with the absolute minimum configuration. Create a directory for our project: mkdir tinyfilemanager-docker && cd tinyfilemanager-docker touch docker-compose.yml When paired with Docker Compose , it becomes
Open docker-compose.yml and paste the following: version: '3.8' services: tinyfilemanager: image: tinyfilemanager/tinyfilemanager:latest container_name: tinyfilemanager ports: - "8080:80" volumes: # Mount the directory you want to manage - /path/to/your/local/data:/var/www/html/data # Optional: Persist TFM's own config (user accounts, auth string) - tinyfilemanager_config:/var/www/html/config environment: - TFM_USERNAME=admin - TFM_PASSWORD=SecurePass123! - TFM_ALLOW_EXTERNAL=true restart: unless-stopped volumes: tinyfilemanager_config:
Explanation of directives: