
Setup Filebrowser-Quantum with Cloudflare on Docker
Contents
Learn to deploy a secure personal cloud with Filebrowser-Quantum, OnlyOffice, and Cloudflare Tunnel using Docker.
Introduction to the Components
- Filebrowser-Quantum: A web-based file manager that lets you upload, download, manage, and share your files. We’ll be using the gtstef/filebrowser fork, which includes some nice enhancements.
- OnlyOffice Document Server: An open-source office suite that provides online editors for text documents, spreadsheets, and presentations. We’ll integrate it with Filebrowser to edit documents directly in the browser.
- Cloudflare Tunnel: A service that creates a secure, outbound-only connection between your server and the Cloudflare network. This allows you to expose your services to the internet without opening up any ports on your firewall, protecting you from direct attacks.
Prerequisites
Before you begin, make sure you have the following installed on your server:
- Docker: Install Docker
- Docker Compose: Install Docker Compose
- A Cloudflare account and a domain name connected to it. You will need two separate subdomains (or domains): one for Filebrowser and one for OnlyOffice.
1. Project Structure
First, let’s create a directory for our project and the necessary subdirectories and files.
| |
This will be the structure:
| |
2. Docker Compose Configuration
Now, let’s set up our docker-compose.yml. This file defines all the services, networks, and volumes needed for our application stack. Instead of one large file, we’ll break it down by service to make it easier to understand.
Create a docker-compose.yml file and add the following services one by one.
Cloudflared
This service creates a secure tunnel from your server to the Cloudflare network, exposing your local services to the internet without opening any firewall ports.
| |
TUNNEL_TOKEN: This is the secret token you get from the Cloudflare Zero Trust dashboard to authenticate your tunnel.network_mode: "host": This is required for the tunnel to correctly route traffic to your other Docker containers.
Filebrowser
This is the core file manager service. It’s a feature-rich web application for managing your files.
| |
environment: We pass several variables to configure Filebrowser, including the path to the config file, database, admin password, and the OnlyOffice JWT secret.volumes: We mount several directories, including one for your main files (/srv/Home) and another for an external drive (/srv/External).ports: We expose port80so it’s accessible locally for Cloudflare Tunnel to pick up.
OnlyOffice Document Server
This service provides the powerful document editing suite that integrates with Filebrowser.
| |
depends_on: This ensures thatpostgresandrabbitmqare started before OnlyOffice.JWT_SECRET: This must be the same secret key provided to Filebrowser to secure the integration.ports: We map the internal port80to the host’s port81, which Cloudflare Tunnel will use.
Supporting Services (Postgres & RabbitMQ)
OnlyOffice requires a database and a message broker to function correctly.
| |
- PostgreSQL: A robust open-source object-relational database system.
- RabbitMQ: A popular message broker.
Networks
Finally, we define the network that allows the containers to communicate with each other.
| |
- The
onlyoffice-networkis a bridge network that Filebrowser, OnlyOffice, Postgres, and RabbitMQ use to communicate internally.cloudflareddoes not need to be on this network as it uses the host network.
3. Filebrowser Configuration
Next, create the configuration file for Filebrowser. This file, which we named config.json, controls various aspects of Filebrowser’s behavior.
Paste the following into config.json:
| |
Note: You’ll need to customize the internalUrl in both the server and integrations.office sections to match your server’s local IP address. Also, change integrations.office.url to the public URL for your OnlyOffice instance (which we’ll set up with Cloudflare).
4. Environment Variables
Create a .env file to store your secrets and environment-specific configurations.
| |
Info
For more available environment variables, you can refer to the Filebrowser-Quantum environment-variables.
5. Cloudflare Tunnel Configuration
- Go to the Cloudflare Zero Trust dashboard.
- Navigate to
Nerworks->Connectors. Create a tunnel, give it a name, and select “Docker” as the connector.- Copy the token provided and paste it into your
.envfile underCLOUDFLARE_SECRET. - After creating the tunnel, go to the “Public Hostnames” tab and add hostnames for Filebrowser (e.g.,
drive.yourdomain.com) and OnlyOffice (e.g.,docs.yourdomain.com).- Point the Filebrowser hostname to the service
http://YOUR_SERVER_IP:80. - Point the OnlyOffice hostname to the service
http://YOUR_SERVER_IP:81.
- Point the Filebrowser hostname to the service
Info
For a more detailed guide, refer to the official cloudflare-tunnel documentation.
6. Running the Stack
With all the configuration in place, you can now start all the services.
| |
This command will pull the necessary images and start all the containers in the background. You can check the logs to ensure everything is running correctly:
| |
Conclusion
You should now have a fully functional personal cloud accessible at the domain you configured in Cloudflare. You can log in to Filebrowser with the admin username (admin as per the config) and the password you set in the .env file. From there, you can create new users, manage your files, and edit documents with the integrated OnlyOffice suite.
This setup provides a secure and private alternative to commercial cloud storage, giving you full control over your data. Enjoy your new personal cloud!




