TinyFileManager is a powerful, lightweight, single-file PHP application designed to manage files via a web browser. While it can be deployed by simply uploading a single .php file to a server, using Docker Compose is the preferred modern method for ensuring consistent environments, simplified updates, and secure, isolated execution. 1. Prerequisites
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
Prepare Directories: Ensure the /path/to/your/files on your host machine exists and has appropriate permissions. The first bind mount is crucial
Then Nextcloud users can manage files via TFM’s interface. Create config
/path/to/your/local/data with an absolute path on your host (e.g., /mnt/storage or ./files for a relative path). This is where your actual files live.config.php and user auth data so your credentials persist across container updates.Create config.php on the host:
| Problem | Solution |
|---------|----------|
| White screen after login | Clear browser cache. The session might be corrupted. Or check docker logs tinyfilemanager for PHP errors. |
| Upload fails for large files | Increase PHP limits (Step 6) and also ensure your reverse proxy (Nginx/Traefik) client_max_body_size is increased. |
| Permissions error on upload | The mounted directory must be owned by UID 33 (www-data). Run sudo chown -R 33:33 ./data on host. |
| "Invalid configuration" in terminal | The container lacks shell utilities. Use a custom image that includes bash and procps. |
| I forgot my password | Stop the container, remove the named volume tinyfilemanager_config, and restart. Credentials will reset to env vars. |
version: '3.8'
- 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.