-
-
Couldn't load subscription status.
- Fork 68
Quick‐Start‐Docker‐Compose.md
Chris edited this page Aug 11, 2025
·
13 revisions
This guide provides the quickest way to get DockFlare running using Docker Compose.
Create a file named docker-compose.yml with the following content. This defines the DockFlare service, its network, and a volume for persistent state.
version: '3.8'
services:
dockflare:
image: alplat/dockflare:stable
container_name: dockflare
restart: unless-stopped
# The Web UI port. You can change the host port if 5000 is in use.
ports:
- "5000:5000"
# This file contains your Cloudflare credentials and settings.
environment:
# Set your local timezone to see correct timestamps in the logs.
- TZ=Europe/Zurich
volumes:
# Required to monitor Docker start/stop events.
- /var/run/docker.sock:/var/run/docker.sock:ro
# Persistent storage for state.json, which holds manual rules and UI overrides.
- dockflare_data:/app/data
networks:
# This is the network DockFlare uses to communicate with the managed
# cloudflared agent and any other services you want to expose.
- cloudflare-net
# Optional: Expose the DockFlare UI itself through the tunnel.
# Remember to configure an Access Policy to secure it!
labels:
- "dockflare.enable=true"
- "dockflare.hostname=dockflare.yourdomain.tld" # <-- Update with your domain
- "dockflare.service=http://dockflare:5000"
- "dockflare.access.policy=authenticate" # <-- Example: secure with Cloudflare Access
volumes:
dockflare_data:
name: dockflare_data
networks:
cloudflare-net:
name: cloudflare-netNote: The labels on the dockflare service are optional but recommended. They demonstrate how to expose a service—in this case, the DockFlare UI itself. Make sure to choose a secure access.policy if you use them.
Navigate to the directory containing your docker-compose.yml and .env files in your terminal and run:
docker compose up -dThis command will:
- Pull the
alplat/dockflare:stableimage. - Create the
cloudflare-netnetwork if it doesn't exist. - Create the
dockflare_datavolume for persistent state. - Start the
dockflarecontainer in detached mode (-d).
DockFlare will now start up. In the background, it will:
- Connect to Cloudflare and create (or find) the tunnel named
dockflare-tunnel. - Create and start a new container named
cloudflared-agent-dockflare-tunnel. - Begin listening for other containers on your system with the
dockflare.enable="true"label.
- Access the Web UI to monitor DockFlare's status.
- Learn how to Label Your Containers to expose them through the tunnel.