-
-
Couldn't load subscription status.
- Fork 68
InternalvsExternalcloudflared.md
Chris edited this page Jun 22, 2025
·
4 revisions
DockFlare can operate in two distinct modes regarding the cloudflared agent—the software that establishes the secure connection to Cloudflare's edge network.
In this mode, DockFlare takes full responsibility for the cloudflared agent's entire lifecycle. It provides a "batteries-included" experience.
-
How it Works:
- DockFlare creates a Cloudflare Tunnel resource on your account using the
TUNNEL_NAMEyou provide. - It securely retrieves that tunnel's unique credentials (the Tunnel Token).
- It deploys and runs a dedicated
cloudflaredDocker container, passing it the token to establish the connection. -
Crucially, DockFlare continuously reconciles this agent. On startup, it checks if the agent's configuration (like its network or image version) matches your
.envsettings and automatically recreates it if there's a mismatch. This ensures your configuration changes are always applied. - DockFlare then manages the ingress rules for this tunnel.
- DockFlare creates a Cloudflare Tunnel resource on your account using the
-
Configuration:
-
USE_EXTERNAL_CLOUDFLARED=false(or simply omit the variable). -
TUNNEL_NAMEenvironment variable is required.
-
-
Pros:
- Easiest Setup: The simplest way to get started. DockFlare handles everything.
-
Self-Contained & Automated: No need to manually manage a separate
cloudflaredinstance or worry about configuration drift.
-
Cons:
- Creates a dedicated tunnel for DockFlare's services. If you have complex, pre-existing tunnel setups, External Mode might be a better fit.
In this mode, you manage the cloudflared agent yourself, and DockFlare acts purely as a configuration controller for that existing tunnel.
-
How it Works:
- You must have an existing Cloudflare Tunnel already created.
- You are responsible for running the
cloudflaredagent process (e.g., as a system service or another Docker container) and keeping it connected to Cloudflare. - DockFlare uses the Cloudflare API to add, update, and remove ingress rules and DNS records for the existing tunnel you specify.
- DockFlare does not create a tunnel or manage any
cloudflaredagent container itself.
-
Configuration:
-
USE_EXTERNAL_CLOUDFLARED=trueis required. -
EXTERNAL_TUNNEL_IDis required. You must provide the UUID of your existing tunnel. -
TUNNEL_NAMEis ignored.
-
-
Pros:
- Allows integration with pre-existing
cloudflareddeployments. - Enables sharing a single tunnel across multiple applications or controllers.
- Gives you full, manual control over the
cloudflaredagent's deployment.
- Allows integration with pre-existing
-
Cons:
- More Complex Setup: You are responsible for the tunnel and agent's operational state.
- Requires you to find and provide the
EXTERNAL_TUNNEL_ID.
-
Use Internal Mode if:
- You are new to Cloudflare Tunnels and want the easiest, most automated setup.
- You want a dedicated, self-managing tunnel for the services DockFlare exposes.
- This is the recommended mode for most users.
-
Use External Mode if:
- You are an advanced user with an existing
cloudflaredtunnel you want to integrate with. - You have a specific reason to manage the
cloudflaredagent's lifecycle separately from DockFlare.
- You are an advanced user with an existing
-
External
cloudflaredMode for detailed setup instructions.