Skip to content

Cloudflared

Cloudflared is the client for Cloudflare Tunnel. It runs next to your private services, creates an outbound tunnel to Cloudflare, and lets Cloudflare route traffic to your services without exposing public ports on Sliplane.

This guide will give an example of how to set up Cloudflared on Sliplane and add a published application.

  • A Cloudflare account
  • A domain added to Cloudflare
  • A Sliplane server with private services you want to expose
  1. Log in to the Cloudflare dashboard
  2. Go to Networking > Tunnels
  3. Click Create Tunnel
  4. Give your tunnel a name and click Create Tunnel
  5. Select Docker
  6. Copy the token from the install command

The token is the long string after --token in the Docker command.

Use the Cloudflared preset to create the service:

Deploy Cloudflared

Before deploying, replace the placeholder for environment variable TUNNEL_TOKEN with the token from Step 1.

After deployment, go back to the Cloudflare dashboard. The tunnel should show as Healthy within a few seconds.

In the Cloudflare dashboard:

  1. Go to Networking > Tunnels
  2. Click your tunnel
  3. Open the Routes tab
  4. Click Add route > Published application
  5. Set the Subdomain and Domain you want to use
  6. Set the Service URL to your Sliplane service’s internal hostname and port

For example, if your private service is called my-service and listens on port 3000, use:

http://my-service.internal:3000

Cloudflared can reach private Sliplane services on the same server through their .internal hostnames. Public traffic goes to Cloudflare first, then through the outbound tunnel to your private service.

Once the route is saved, open the domain you configured in Cloudflare:

https://app.example.com

The service remains private on Sliplane. Only Cloudflared connects to it internally.

Tunnel disconnected:

  • Make sure the status of the tunnel is Healthy in the Cloudflare dashboard
  • Verify that TUNNEL_TOKEN is set correctly
  • Check the service logs in Sliplane

Requests are not reaching your service:

  • Verify the internal hostname and port in the Cloudflare route
  • Make sure the target service is running on the same Sliplane server
  • Confirm that the target service is listening on the port you configured

Route works locally but not through Cloudflare:

  • Check that your domain is active in Cloudflare
  • Verify that the published application uses the right hostname
  • Review Cloudflare Access rules if you enabled access policies

See Cloudflare Tunnel Troubleshooting for more resources that help you resolve issues with Cloudflare Tunnel connectivity and configuration.