Routing
Last updated Oct 16, 2026
Cloudflare Tunnel routes traffic from Cloudflare's network to services running behind cloudflared. When you publish an application, you map a public hostname to a local service — for example, app.example.com to http://localhost:8080 — and Cloudflare applies CDN caching, WAF, and DDoS protection before forwarding the request to your origin.

Published applications
A published application is a hostname-to-service mapping defined in your tunnel configuration. Each mapping tells cloudflared which local service should receive traffic for a given public hostname.
You can publish multiple applications on a single tunnel. For each application, specify:
- Public hostname — The domain or subdomain that users visit (for example,
app.example.com). - Service — The local address or socket where the application is running (for example,
http://localhost:8080).
When you add a route through the dashboard, Cloudflare automatically creates a DNS record pointing the hostname to your tunnel subdomain (<UUID>.cfargotunnel.com).
Note
Public hostname routes proxy traffic through Cloudflare. On Free, Pro, and Business plans, the service-specific terms ↗︎ require you to use a specific paid service to serve video and other large files.
Refer to Delivering videos with Cloudflare for more information. To transfer large files privately, use a private network route instead.
Published application limits
A single remotely-managed tunnel supports roughly 5,000–10,000 published applications. The limit is based on the size of the tunnel configuration, which can be up to 1 MB.
The tunnel configuration is the set of ingress rules and origin settings that Cloudflare stores for a remotely-managed tunnel when you add published applications in the dashboard or with the API. Each published application adds one ingress rule, and a typical rule is 100–200 bytes. Rules with long hostnames, paths, or many origin parameters take up more space and reduce the number of published applications a tunnel can hold.
Published applications do not count toward the account limit for routes. Routes are CIDR and hostname routes for private network traffic, and have a separate limit of 50,000 per account.
If you need to publish more applications, distribute them across multiple tunnels. Each account includes 1,000 tunnels. To run more, refer to Tunnels for Platforms.
Supported protocols
The table below lists the service types you can route to a public hostname. Non-HTTP services require installing cloudflared on the client for end users to connect.
| Service type | Description | Example service value |
|---|---|---|
| HTTP | Proxies incoming HTTPS requests to your local web service over HTTP. | http://localhost:8000 |
| HTTPS | Proxies incoming HTTPS requests directly to your local web service. You can disable TLS verification for self-signed certificates. | https://localhost:8000 |
| UNIX | Same as HTTP, but uses a Unix socket. | unix:/home/production/echo.sock |
| UNIX + TLS | Same as HTTPS, but uses a Unix socket. | unix+tls:/home/production/echo.sock |
| TCP | Streams TCP over a WebSocket connection. End users run cloudflared access tcp to connect. For long-lived connections, use Client-to-Tunnel instead. |
tcp://localhost:2222 |
| SSH | Streams SSH over a WebSocket connection. End users run cloudflared access ssh to connect. For long-lived connections, use Client-to-Tunnel instead. |
ssh://localhost:22 |
| RDP | Streams RDP over a WebSocket connection. For more information, refer to Connect to RDP with client-side cloudflared. | rdp://localhost:3389 |
| SMB | Streams SMB over a WebSocket connection. For more information, refer to Connect to SMB with client-side cloudflared. | smb://localhost:445 |
| HTTP_STATUS | Responds to all requests with a fixed HTTP status code. | http_status:404 |
| BASTION | Allows cloudflared to act as a jump host, providing access to any local address. |
bastion |
| HELLO_WORLD | Test server for validating your Cloudflare Tunnel connection (for locally managed tunnels only). | hello_world |
IPv6 service addresses
When the service value is an IPv6 literal, wrap the address in square brackets as defined by RFC 3986 ↗︎. The brackets are required so that the : characters in the address are not confused with the port separator.
| Service type | Example service value |
|---|---|
| HTTP | http://[2001:db8::1]:8000 |
| HTTPS | https://[2001:db8::1]:443 |
| TCP | tcp://[2001:db8::1]:2222 |
| SSH | ssh://[2001:db8::1]:22 |
| RDP | rdp://[2001:db8::1]:3389 |
Hostnames and IPv4 addresses do not need brackets — http://localhost:8000 and http://192.0.2.1:8000 are valid as-is.
DNS records
When you create a tunnel, Cloudflare generates a subdomain at <UUID>.cfargotunnel.com. You point a CNAME record at this subdomain to route traffic from your hostname to the tunnel.
FedRAMP High
On accounts in Cloudflare's FedRAMP High ↗︎ environment, CNAME records must point to the tunnel subdomain <UUID>.fed-cfargotunnel.com instead of <UUID>.cfargotunnel.com. A CNAME record that points to <UUID>.cfargotunnel.com will return a 530 error with error code 1033, even when the tunnel is healthy. For more information, refer to Error 1033.
The cfargotunnel.com subdomain only proxies traffic for DNS records in the same Cloudflare account. If someone discovers your tunnel UUID, they cannot create a DNS record in another account to proxy traffic through it.
Create a DNS record
To create a DNS record for a Cloudflare Tunnel:
- Log in to the Cloudflare dashboard ↗︎ and go to DNS Records for your domain. Go to Records ↗
- Select Add record.
- Enter the following values:
- Type: CNAME
- Name: Subdomain of your application
- Target:
<UUID>.cfargotunnel.com - Select Save.

For locally-managed tunnels, run the following command to create a CNAME record pointing to your tunnel subdomain:
cloudflared tunnel route dns <UUID or NAME> www.app.com
This creates a CNAME record but does not proxy traffic unless the tunnel is running.
Note
To create DNS records using cloudflared, the cert.pem file must be installed on your system.
The DNS record and the tunnel are independent. You can create DNS records that point to a tunnel that is not running. If a tunnel stops, the DNS record is not deleted — visitors will see a 1016 error.
You can also create multiple DNS records pointing to the same tunnel subdomain. If you route traffic from multiple hostnames to multiple services, create a CNAME entry for each hostname. All entries share the same target.
Load balancing
Use a public load balancer to distribute traffic across servers running your published applications. This provides health-check-based failover and intelligent traffic steering across regions.
graph LR
accTitle: Load balancing traffic to applications behind Cloudflare Tunnel
A[Internet] --> C{Cloudflare <br> Load Balancer}
C -- Tunnel 1 --> cf1
C -- Tunnel 2 --> cf2
subgraph F[Data center 2]
cf2[cloudflared]
S3[App server]
S4[App server]
cf2-->S3
cf2-->S4
end
subgraph E[Data center 1]
cf1[cloudflared]
S1[App server]
S2[App server]
cf1-->S1
cf1-->S2
end
Replicas versus load balancers
Running multiple cloudflared replicas on the same tunnel UUID provides basic redundancy — if one host fails, other replicas continue serving traffic. However, the load balancer treats all replicas of the same tunnel UUID as a single endpoint.
For granular traffic steering and session affinity, connect each host using a different tunnel UUID so the load balancer can address them independently.
Add a tunnel to a load balancer pool
Prerequisites
A Cloudflare Tunnel with at least one published application route.
To create a load balancer for Cloudflare Tunnel published applications:
- In the Cloudflare dashboard, go to the Load Balancing page. Go to Load Balancing ↗
- Select Create load balancer, then select Public load balancer.
- Under Select website, select the domain of your published application route.
- On the Hostname page, enter a hostname for the load balancer (for example,
lb.example.com). - On the Pools page, select Create a pool and enter a descriptive name.
- Add a tunnel endpoint with the following values:
- Endpoint Name: Name of the server running the application
- Endpoint Address:
<UUID>.cfargotunnel.com(find the Tunnel ID in the [Cloudflare dashboard](https://dash.cloudflare.com/) under **Networking** > **Tunnels**) - Header value: Hostname of your published application route (for example,
app.example.com) - Weight:
1(if only one endpoint)
Note
A single origin pool cannot reference the same tunnel UUID twice.
7. Choose a Fallback pool. Refer to traffic steering policies for routing options.
8. (Recommended) On the Monitors page, attach a monitor to the endpoint. For an HTTP or HTTPS application, create an HTTPS monitor:
- Type: HTTPS
- Path: /
- Port: 443
- Expected Code(s): 200
- Header Name: Host
- Value: app.example.com
9. Save and deploy the load balancer.
To test, access your application using the load balancer hostname (lb.example.com).
<details>
<summary>
Monitor TCP tunnel origins
</summary>
TCP monitors are not supported for tunnel endpoints. Instead, create a health check endpoint on the <code>cloudflared</code> host and use an HTTPS monitor. For example, you can use <code>cloudflared</code> to return a fixed HTTP status response:
- <a href="https://developers.cloudflare.com/tunnel/get-started/#publish-an-application">Add a published application route</a> for the health check:
- Hostname: <code>health-check.example.com</code>
- Service Type: HTTP_STATUS
- HTTP Status Code: <code>200</code>
- <a href="https://developers.cloudflare.com/load-balancing/monitors/create-monitor/">Create a monitor</a> with these settings:
- Type: HTTPS
- Path: <code>/</code>
- Port: <code>443</code>
- Expected Code(s): <code>200</code>
- Header Name: <code>Host</code>
- Value: <code>health-check.example.com</code>
This monitor verifies that <code>cloudflared</code> is reachable. It does not check whether the upstream service is accepting requests.
</details>
<details>
<summary>
Local connection preference
</summary>
If you notice traffic imbalances across endpoints in different locations, you may need to adjust your load balancer configuration.
Cloudflare uses <a href="https://www.cloudflare.com/learning/cdn/glossary/anycast-network/">Anycast routing ↗︎</a> to direct end user requests to the nearest data center. <code>cloudflared</code> prefers to serve requests using connections in the same data center, which can affect how traffic is distributed across endpoints.
If you run <a href="https://developers.cloudflare.com/tunnel/configuration/#replicas-and-high-availability"><code>cloudflared</code> replicas</a> on the same tunnel UUID, consider switching to separate tunnels for more granular control over <a href="https://developers.cloudflare.com/load-balancing/understand-basics/traffic-steering/">traffic steering</a>.
</details>
Cloudflare settings
Published applications inherit the Cloudflare settings for their hostname, including cache rules, WAF rules, and other Rules configurations. You can change these settings for each hostname in the Cloudflare dashboard ↗︎.
If you use a load balancer, settings are applied to the load balancer hostname instead.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/tunnel/concepts/routing/#page","headline":"Routing","description":"Route traffic to private networks and services through Cloudflare Tunnel.","url":"https://developers.cloudflare.com/tunnel/concepts/routing/","inLanguage":"en","image":"https://developers.cloudflare.com/tunnel/concepts/routing/og.png?v=77cf48f030d654f8","dateModified":"2026-10-16","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["DNS","WebSockets"]}
description: Install and run cloudflared as a systemd service on Linux. title: Linux image: https://developers.cloudflare.com/tunnel/features/locally-managed-tunnels/as-a-service/linux/og.png?v=c41267ce284180cc
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/tunnel/llms.txt
Use this file to discover all available pages before exploring further.
