Cloudflare Tunnel

Reach the panel through Cloudflare when its server cannot accept connections from the internet.

Settings -> Deplo -> Advanced -> Panel access, instance admins only.

For a panel behind a home or office router, or anywhere port 443 can't be opened. A connector next to the panel dials out to Cloudflare, and Cloudflare serves the panel's address over that connection, HTTPS certificate included.

You need:

  • A domain on your Cloudflare account, like example.com.
  • A Cloudflare API token with these permissions:
TypeItemPermission
AccountCloudflare TunnelEdit
ZoneDNSEdit
ZoneZoneRead

Deplo does the rest: it creates the tunnel, its routes and the DNS record, starts the connector, checks that the address answers, then moves the panel.

Turn it on

Turn on Cloudflare Tunnel

Settings -> Deplo -> Advanced. The dialog Serve the panel through Cloudflare opens.

Create the token

Create one opens Cloudflare's token form with all three permissions filled in. Create it and copy it.

Enter the address and the token

For example deplo.example.com. Continue shows what the move affects (passkeys, sessions, deploy hooks), like any change of the panel address.

Confirm

It usually takes under a minute. If the address does not answer through the tunnel, Deplo undoes every step, in Cloudflare too, and the panel stays where it was.

What Deplo creates

WhereWhat
CloudflareA tunnel named like deplo-deplo.example.com-3f9a1c
CloudflareIts routes: deplo.example.com/api/agent/link for your servers, deplo.example.com for the panel, and deplo.example.com/api/cluster/relay once you have a cluster
CloudflareA proxied CNAME deplo.example.com -> <tunnel id>.cfargotunnel.com
Your serverA deplo-tunnel container next to the panel's proxy

Deplo touches no other DNS record. If the address already points somewhere else, it refuses and names that record. A record that points at this server, like the panel's own domain, is replaced.

Servers you add connect through the tunnel too, so nothing is opened on them either. The backup address stays as it is.

While it is on

  • The panel address on the General tab is read-only. Use Cloudflare Tunnel -> Change address: Deplo keeps the tunnel and moves its DNS record.
  • The HTTPS switch is locked. Cloudflare serves the certificate.
  • The status is live. Connected comes from Cloudflare. Not connected means this server lost its link to Cloudflare: check its internet connection.
  • The token stays encrypted and is never shown again. To replace it, use Change address with the same address and the new token.
  • If Cloudflare refuses the token while adding a cluster's route, the cluster shows Fix in Cloudflare: create a new token, paste it, and Deplo switches to it once Cloudflare accepts it. See When Cloudflare refuses Deplo's token.
  • Updates keep the tunnel.

Turn it off

Turn off Cloudflare Tunnel. Deplo moves the panel to its backup address, or one you type, checks that it answers, removes the connector, then deletes the tunnel and its DNS record in Cloudflare. If Cloudflare refuses the deletion, for example because the token was revoked, the panel still moves and Deplo tells you what is left to delete by hand.

Behind a router, the backup address may not answer

If the server is not reachable from the internet, the new address can't answer either. Turning the tunnel off then fails safely: the panel stays on the tunnel.

If the tunnel breaks

On the machine Deplo runs on:

deplo recover panel-address -
deplo restart

As it starts, Deplo moves the panel to the generated address, removes the connector and deletes the tunnel and its DNS record in Cloudflare. If the saved token no longer works, Activity says what is left to delete under Zero Trust -> Networks -> Tunnels. See Break-glass recovery.

Next steps

Did this page help you?

On this page