Tinyfilemanager Docker Compose
version: '3.8'
services:
tinyfilemanager:
image: prasath89/tinyfilemanager:latest
container_name: tinyfilemanager
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ./data:/var/www/html/data # Persistent storage for uploaded files
- ./config/config.php:/var/www/html/config.php # Optional: custom config
environment:
- USERNAME=admin # Optional: set custom username
- PASSWORD=admin123 # Optional: set custom password
- TZ=UTC # Timezone
networks:
- filemanager-net
networks:
filemanager-net:
driver: bridge
Next Steps
- Explore the official TinyFileManager GitHub for advanced configuration options (custom themes, external auth hooks).
- Automate backups of your
./datadirectory using a cron job or a dedicated backup container. - Set up a CI/CD pipeline to automatically update the Docker image and restart the container.
Final warning: A web file manager is a double-edged sword. It provides incredible convenience, but if misconfigured or left unsecured, it can expose your entire server. Always follow the principle of least privilege—only mount the directories you absolutely need, always use HTTPS, and monitor access logs.
Now go ahead and deploy your own TinyFileManager with Docker Compose. You’ll wonder how you ever managed files without it.
Resources:
Happy file managing! 🚀
version: '3'
services:
tinyfilemanager:
image: tinyspeck/tinyfilemanager
ports:
- "80:80"
volumes:
- ./data:/var/www/html
environment:
- USER=your_username
- PASS=your_password
Let me explain what each part does:
image: Specifies the Docker image to use.tinyspeck/tinyfilemanageris the official image for Tiny File Manager.ports: Maps port 80 of the host machine to port 80 in the container, allowing you to access the file manager from outside the container.volumes: Maps a directory on your host (./data) to a directory in the container (/var/www/html). This is where your files will be stored and accessed through Tiny File Manager. Make sure to create adatadirectory in the same directory as yourdocker-compose.ymlfile.environment: Sets environment variables in the container. Here, you can set a username (USER) and password (PASS) for logging into Tiny File Manager.
6.3 Restrict File Operations
Set environment variable:
- TFM_DISABLE_UPLOAD=false
- TFM_DISABLE_DELETE=false
- TFM_DISABLE_RENAME=false
(Check image documentation for exact variable names.)
View live logs
docker compose logs -f tinyfilemanager
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. tinyfilemanager docker compose
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.
Introduction: The Need for a Lightweight File Manager
In the world of system administration and web development, we often face a common problem: you need to upload, download, edit, or manage files on a remote server, but you only have SSH access (or worse, no direct access at all). While command-line tools like scp, rsync, or sftp are powerful, they lack the visual immediacy of a Graphical User Interface (GUI).
Enter TinyFileManager (TFM). This single PHP file (weighing just around 150KB) provides a full-featured, responsive, and secure web-based file manager. It allows you to browse, edit, copy, move, upload, archive, and even protect directories with passwords—all from your browser.
However, running PHP applications natively on a server can lead to dependency hell, version conflicts, and security headaches. This is where Docker and Docker Compose shine. By containerizing TinyFileManager, you get a portable, isolated, and easily deployable file manager that can run on any Linux, Windows, or macOS system with Docker installed. version: '3
In this comprehensive guide, we will explore:
- What TinyFileManager is and its key features.
- Why Docker Compose is the ideal deployment method.
- Step-by-step setup with a production-ready
docker-compose.yml. - Advanced configurations (themes, authentication, upload limits).
- Security best practices.
- Integration with other containers (Nextcloud, Nginx, etc.).
- Troubleshooting common issues.
Install additional PHP extensions if needed
RUN docker-php-ext-install zip
2. Create docker-compose.yml
version: '3'services: db: image: mariadb:latest container_name: tfm_db environment: MYSQL_ROOT_PASSWORD: my_secret_root_password MYSQL_DATABASE: tinyfilemanager MYSQL_USER: tfm_user MYSQL_PASSWORD: tfm_password volumes: - ./db_data:/var/lib/mysql restart: unless-stopped
web: image: tinyfilemanager/tinyfilemanager:master container_name: tinyfilemanager ports: - "8080:80" volumes: - ./data:/var/www/html/data # Allow TinyFilemanager to manage your docker containers (Optional) - /var/run/docker.sock:/var/run/docker.sock environment: - TZ=America/New_York # Database Configuration - DB_HOST=db - DB_NAME=tinyfilemanager - DB_USER=tfm_user - DB_PASS=tfm_password depends_on: - db restart: unless-stoppedNext Steps











