Skip to content

Cloudflared installable feature ​

Optional Feature

This feature is not preinstalled in Kloud Workspace. Install it with the features system first.

Cloudflare Tunnel exposes the workspace to the internet through an outbound-only connection to Cloudflare's edge, with no inbound ports and no public IP on the host.

The cloudflared feature installs the tunnel connector. Once a tunnel token is supplied, the workspace runs and supervises the tunnel automatically. After a manual install in a running workspace, the tunnel starts with the next container start.

Installation ​

Install cloudflared using the features system:

sh
# Manual installation
ws-cli feature install cloudflared

# Or at boot time
docker run \
  -e WS_FEATURES_ADDITIONAL_FEATURES="cloudflared" \
  ghcr.io/kloudkit/workspace:v0.6.0

Running a Tunnel ​

⚠️ WARNING

The workspace has no sign-in until you set one. Turn on authentication before you expose it through a tunnel.

Create a remotely-managed tunnel in the Cloudflare dashboard and copy its connector token. In the tunnel's configuration, route your public hostname to http://localhost:8080, the editor's port inside the container.

Provide the token and the tunnel starts automatically on boot:

  • WS_CLOUDFLARED_TUNNEL_TOKEN: Cloudflare tunnel connector token.
sh
docker run \
  -e WS_CLOUDFLARED_TUNNEL_TOKEN="<token>" \
  -e WS_FEATURES_ADDITIONAL_FEATURES="cloudflared" \
  ghcr.io/kloudkit/workspace:v0.6.0

The tunnel is supervised: if it exits, it is restarted automatically. When no token is set, the tunnel stays dormant.

💡 TIP

WS_CLOUDFLARED_TUNNEL_TOKEN is a secret.

Besides the literal value, you can supply it as a file: reference (file:/path/to/token) or mount it at /run/secrets/workspace/cloudflared/tunnel_token.

Logs ​

Inspect the tunnel's output with ws-cli:

sh
ws-cli logs --target=cloudflared

Released under the MIT License