<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Cloudflared on KnightLi Blog</title>
        <link>https://knightli.com/en/tags/cloudflared/</link>
        <description>Recent content in Cloudflared on KnightLi Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Tue, 23 Jun 2026 20:37:00 +0800</lastBuildDate><atom:link href="https://knightli.com/en/tags/cloudflared/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Cloudflare Tunnel Beginner Guide: Expose Internal Services Without a Public IP</title>
        <link>https://knightli.com/en/2026/06/23/cloudflare-tunnel-cloudflared-public-hostname-guide/</link>
        <pubDate>Tue, 23 Jun 2026 20:37:00 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/06/23/cloudflare-tunnel-cloudflared-public-hostname-guide/</guid>
        <description>&lt;p&gt;Cloudflare Tunnel is a reverse connectivity solution from Cloudflare. The idea is simple: instead of opening public inbound ports on your server, you run a lightweight daemon named &lt;code&gt;cloudflared&lt;/code&gt; on an internal machine, and it actively establishes an outbound encrypted connection to Cloudflare.&lt;/p&gt;
&lt;p&gt;With that in place, your web services, APIs, staging environments, home servers, NAS dashboards, and some internal apps can be accessed through a public hostname managed by Cloudflare. The origin itself does not need a public IP, and you do not need to configure port forwarding on your router.&lt;/p&gt;
&lt;p&gt;Official documentation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://developers.cloudflare.com/tunnel/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Cloudflare Tunnel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://developers.cloudflare.com/tunnel/setup/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Tunnel setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://developers.cloudflare.com/tunnel/routing/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Tunnel routing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;what-cloudflare-tunnel-solves&#34;&gt;What Cloudflare Tunnel Solves
&lt;/h2&gt;&lt;p&gt;Traditional ways to expose a service usually come with several annoyances:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The server needs a public IP.&lt;/li&gt;
&lt;li&gt;A router or cloud firewall needs to allow inbound ports.&lt;/li&gt;
&lt;li&gt;The origin IP can be scanned and attacked directly.&lt;/li&gt;
&lt;li&gt;Home networks, private networks, and temporary test environments are awkward to expose over HTTPS.&lt;/li&gt;
&lt;li&gt;Reverse proxying, certificates, port forwarding, and dynamic DNS all need ongoing maintenance.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cloudflare Tunnel changes the direction of the connection. External traffic does not hit your server directly. Instead, your server connects out to Cloudflare. When users visit your domain, traffic enters Cloudflare first and is then forwarded through the established Tunnel to your local service.&lt;/p&gt;
&lt;p&gt;For everyday use, the most obvious benefits are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No public IP is required.&lt;/li&gt;
&lt;li&gt;No inbound ports need to be opened.&lt;/li&gt;
&lt;li&gt;The origin address can be hidden.&lt;/li&gt;
&lt;li&gt;You can reuse Cloudflare features such as HTTPS, WAF, DDoS protection, and Bot Management.&lt;/li&gt;
&lt;li&gt;It is well suited for publishing internal web services safely under a real domain.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;how-it-works&#34;&gt;How It Works
&lt;/h2&gt;&lt;p&gt;A typical Cloudflare Tunnel flow looks like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install &lt;code&gt;cloudflared&lt;/code&gt; on a server, VM, home machine, or container.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cloudflared&lt;/code&gt; connects out to Cloudflare&amp;rsquo;s global network.&lt;/li&gt;
&lt;li&gt;Create a Tunnel in the Cloudflare dashboard and map a public hostname to a local service.&lt;/li&gt;
&lt;li&gt;Users visit that public hostname.&lt;/li&gt;
&lt;li&gt;Cloudflare receives the request and forwards it through the Tunnel to your internal service.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example, suppose you have a local service running at:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;http://localhost:8080
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;You can map it to:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;app.example.com
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;When users visit &lt;code&gt;https://app.example.com&lt;/code&gt;, the request goes through Cloudflare first, then reaches &lt;code&gt;http://localhost:8080&lt;/code&gt; on your machine.&lt;/p&gt;
&lt;p&gt;Cloudflare&amp;rsquo;s documentation also notes that each Tunnel maintains multiple long-lived connections to different Cloudflare data centers by default. In production, you can also run multiple &lt;code&gt;cloudflared&lt;/code&gt; replicas to improve availability.&lt;/p&gt;
&lt;h2 id=&#34;good-use-cases&#34;&gt;Good Use Cases
&lt;/h2&gt;&lt;p&gt;Cloudflare Tunnel is especially useful for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Internal web dashboards&lt;/strong&gt;: NAS, Homelab, or admin panels on a development machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Temporary demo environments&lt;/strong&gt;: Share a local web app that is still under development.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Self-hosted services&lt;/strong&gt;: Publish APIs, blog admin panels, monitoring dashboards, and similar services under a domain.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Networks without a public IP&lt;/strong&gt;: Home broadband, campus networks, company intranets, or machines behind NAT.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Workloads where you want to hide the origin IP&lt;/strong&gt;: Reduce the chance of direct scanning, credential stuffing, or attacks against the origin.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A unified entry point for multiple services&lt;/strong&gt;: One Tunnel can publish multiple public hostnames that point to different local services.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That said, Cloudflare Tunnel is not a universal &amp;ldquo;internal network tunneling&amp;rdquo; magic button. If you want to publish non-HTTP services such as SSH, RDP, or raw TCP, you usually also need &lt;code&gt;cloudflared&lt;/code&gt; on the client side, or you need to combine it with Cloudflare Zero Trust / Access for a more complete access control model.&lt;/p&gt;
&lt;p&gt;If you only want to publish a normal web service, it is very quick to get started. If you want to use it as a company-grade private access solution, you should also design identity authentication, permission groups, and audit policies.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites
&lt;/h2&gt;&lt;p&gt;Before creating a production Tunnel, check a few things first:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You have a Cloudflare account.&lt;/li&gt;
&lt;li&gt;Your domain is managed by Cloudflare.&lt;/li&gt;
&lt;li&gt;You have a server, VM, container, or local machine with internet access.&lt;/li&gt;
&lt;li&gt;That machine can reach Cloudflare&amp;rsquo;s network.&lt;/li&gt;
&lt;li&gt;If the network has strict firewall rules, confirm that it can reach the outbound connection port used by Cloudflare Tunnel.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The official documentation specifically mentions checking access to Cloudflare&amp;rsquo;s &lt;code&gt;7844&lt;/code&gt; port when the server is in a restrictive network environment.&lt;/p&gt;
&lt;h2 id=&#34;create-a-tunnel-in-the-dashboard&#34;&gt;Create a Tunnel in the Dashboard
&lt;/h2&gt;&lt;p&gt;The easiest way is to use the Cloudflare Dashboard.&lt;/p&gt;
&lt;p&gt;After opening the dashboard, the rough path is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Zero Trust / Networking -&amp;gt; Tunnels -&amp;gt; Create Tunnel
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Then follow the page prompts:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select Cloudflare Tunnel.&lt;/li&gt;
&lt;li&gt;Give the Tunnel a name.&lt;/li&gt;
&lt;li&gt;Select the server operating system and CPU architecture.&lt;/li&gt;
&lt;li&gt;Copy the installation command generated by Cloudflare.&lt;/li&gt;
&lt;li&gt;Run the command on the server to install and start &lt;code&gt;cloudflared&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Return to the dashboard and confirm that the Tunnel status becomes Healthy.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When the Tunnel is Healthy, your server has successfully established a connection to Cloudflare.&lt;/p&gt;
&lt;h2 id=&#34;publish-a-public-hostname&#34;&gt;Publish a Public Hostname
&lt;/h2&gt;&lt;p&gt;After the Tunnel is created, you still need to configure routing. In plain terms, you tell Cloudflare:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;which domain -&amp;gt; forward to which local service
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;For example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;app.example.com -&amp;gt; http://localhost:8080
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Common local service URLs include:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;http://localhost:80
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;https://localhost:443
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;http://192.168.1.10:8080
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;After the configuration is saved, Cloudflare automatically creates a DNS record that points your public hostname to a Tunnel address like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&amp;lt;TUNNEL_ID&amp;gt;.cfargotunnel.com
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Users do not need to visit this address directly. It is only used by Cloudflare internally to route domain traffic to the Tunnel.&lt;/p&gt;
&lt;p&gt;One Tunnel can publish multiple applications. For example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;nas.example.com      -&amp;gt; http://192.168.1.20:5000
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git.example.com      -&amp;gt; http://192.168.1.30:3000
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;monitor.example.com  -&amp;gt; http://localhost:9090
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This lets a single &lt;code&gt;cloudflared&lt;/code&gt; instance manage several internal web services.&lt;/p&gt;
&lt;h2 id=&#34;common-ways-to-run-it&#34;&gt;Common Ways to Run It
&lt;/h2&gt;&lt;p&gt;On Linux or macOS, the Cloudflare dashboard usually provides a service installation command like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo cloudflared service install &amp;lt;TUNNEL_TOKEN&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;On Windows, it is similar:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;cloudflared&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;py&#34;&gt;exe&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;service&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;install&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TUNNEL_TOKEN&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If you prefer Docker, you can also use the official image:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker run cloudflare/cloudflared:latest tunnel --no-autoupdate run --token &amp;lt;TUNNEL_TOKEN&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The &lt;code&gt;&amp;lt;TUNNEL_TOKEN&amp;gt;&lt;/code&gt; is a sensitive credential. Do not commit it to a public repository, and do not share screenshots of it in public forums. Anyone who obtains this token may be able to attach their own &lt;code&gt;cloudflared&lt;/code&gt; instance to your Tunnel.&lt;/p&gt;
&lt;h2 id=&#34;quick-tunnel-is-for-temporary-testing&#34;&gt;Quick Tunnel Is for Temporary Testing
&lt;/h2&gt;&lt;p&gt;Cloudflare also provides a faster temporary mode called Quick Tunnel.&lt;/p&gt;
&lt;p&gt;Run this locally:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cloudflared tunnel --url http://localhost:8080
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;It generates a random &lt;code&gt;trycloudflare.com&lt;/code&gt; subdomain so external users can temporarily access your local service.&lt;/p&gt;
&lt;p&gt;This is useful for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Temporary demos.&lt;/li&gt;
&lt;li&gt;Local webhook debugging.&lt;/li&gt;
&lt;li&gt;Showing a development page to a colleague.&lt;/li&gt;
&lt;li&gt;Testing without binding a production domain yet.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But it is not suitable for production. According to the official documentation, Quick Tunnel has limitations, such as an uncontrolled random domain, concurrent request limits, and missing support for some long-lived connection behavior. Production services should use a standard Tunnel with your own domain.&lt;/p&gt;
&lt;h2 id=&#34;common-pitfalls&#34;&gt;Common Pitfalls
&lt;/h2&gt;&lt;h3 id=&#34;1-the-local-service-is-listening-on-the-wrong-address&#34;&gt;1. The Local Service Is Listening on the Wrong Address
&lt;/h3&gt;&lt;p&gt;If your service only listens on an internal container address, or only allows access from a specific network interface, &lt;code&gt;cloudflared&lt;/code&gt; may not be able to reach it.&lt;/p&gt;
&lt;p&gt;When troubleshooting, first run this on the machine where &lt;code&gt;cloudflared&lt;/code&gt; is running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;curl http://localhost:8080
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If the local machine cannot access the service, Cloudflare Tunnel cannot forward traffic to it either.&lt;/p&gt;
&lt;h3 id=&#34;2-the-firewall-blocks-outbound-connections&#34;&gt;2. The Firewall Blocks Outbound Connections
&lt;/h3&gt;&lt;p&gt;Cloudflare Tunnel does not require inbound ports, but it does need to connect out. If a company network, cloud security group, or local firewall blocks outbound connections, the Tunnel may never become Healthy.&lt;/p&gt;
&lt;p&gt;In that case, focus on outbound access rules, especially the Tunnel connection port mentioned in Cloudflare&amp;rsquo;s documentation.&lt;/p&gt;
&lt;h3 id=&#34;3-the-domain-is-not-managed-by-cloudflare&#34;&gt;3. The Domain Is Not Managed by Cloudflare
&lt;/h3&gt;&lt;p&gt;If you want to publish a formal public hostname, the domain needs to be managed by Cloudflare. Otherwise, Cloudflare cannot automatically create the required DNS route for you.&lt;/p&gt;
&lt;h3 id=&#34;4-do-not-expose-admin-panels-bare&#34;&gt;4. Do Not Expose Admin Panels Bare
&lt;/h3&gt;&lt;p&gt;Cloudflare Tunnel solves &amp;ldquo;how to reach the origin safely&amp;rdquo;, but it does not automatically add a login system to your application.&lt;/p&gt;
&lt;p&gt;If you expose sensitive services such as NAS, Git, monitoring, or database admin panels, add at least one more layer with Cloudflare Access, and restrict access by email, organization account, or identity provider.&lt;/p&gt;
&lt;h3 id=&#34;5-config-file-mode-needs-a-catch-all-rule&#34;&gt;5. Config File Mode Needs a Catch-All Rule
&lt;/h3&gt;&lt;p&gt;If you manage ingress rules through the API or a local config file, the official documentation requires a catch-all rule at the end. A common pattern is returning 404:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;ingress&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;hostname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;app.example.com&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;service&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;http://localhost:8080&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;service&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;http_status:404&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This avoids forwarding unmatched requests to services that should not be reachable.&lt;/p&gt;
&lt;h2 id=&#34;short-summary&#34;&gt;Short Summary
&lt;/h2&gt;&lt;p&gt;Cloudflare Tunnel is best used to publish internal web services to public domains safely and reliably. It does not require a public IP, does not require inbound ports, and is relatively inexpensive to operate.&lt;/p&gt;
&lt;p&gt;If you only want to expose a web panel from a home machine or server, Cloudflare Tunnel is a very practical choice. If you are building a more complex enterprise private access setup, pair it with Cloudflare Access, Zero Trust policies, and more detailed permission controls.&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
