Use Tunnel technology to allow home broadband without a public IP to leverage Cloudflare for free to achieve fast website building (Recommended)
This article was last updated 287 days ago. The information within may have evolved or changed; if anything is outdated or broken, please feel free to leave a message in the comments section.
Article Abstract
To address the issue where home broadband users cannot access the CDN through Cloudflare's conventional methods, a Tunnel technology is adopted to implement a website building solution in an environment without a public IP. By deploying the Docker version of Cloudflare Connector on a Tencent Cloud Lighthouse server and configuring the mapping between the intranet IP and the domain name, Cloudflare can directly access local network services. This solution breaks through the limitations of public IPs and port 443, but the domestic access speed is slow, requiring cooperation with a filed domain name and Tencent Cloud CDN to build a dual-backup system. The core of the technology lies in using Tunnel to establish a logical connection, and subsequent articles will explore access speed optimization strategies.
Qwen3-14B · 2026-06-18

Preface

The free CDN solution provided by Cloudflare for individuals works very well everywhere except in China. However, because Cloudflare normally only accepts second-level domains via NS access, and requires specifying a public IP address when setting up DNS (dynamic public IP does not affect this, as the A record of Cloudflare DNS settings can be updated in real-time via API; whether ports 80 and 443 are available is also not important, as non-standard origin ports can be set via Origin Rules), this is very unfriendly to friends without a public IP (which is the case for most home broadband).

But does having no public IP and no HTTPS port 443 mean you can't get Cloudflare for free?

Of course not. As mentioned, that's under normal circumstances. So how do you get Cloudflare for free under abnormal circumstances? This relies on Cloudflare's Tunnel technology. In fact, the so-called tunnel is to install a ”connector” in your site's ”local” network, thereby logically connecting your local network and Cloudflare ”directly”, which is the same principle as the old VPN. In this way, Cloudflare can directly access the sites in your local network, thereby avoiding the various unfavorable network conditions mentioned above: regardless of whether there is a public IP, whether there is port 443, or which domestic operator's home broadband or cloud provider's cloud host you use, you can directly use Cloudflare to build a website.

Deployment

(Optional) Activate the Free plan of Zero Trust

If you have not used the Zero Trust feature before, you need to initialize it for the first use. Click on Zero Trust in the red box in the figure below:

image.png

You can fill in the Team name in the red box in the figure below as you like:
image.png

Select the Free plan:
image.png

Add a payment method, dual-currency credit card is recommended:
image.png

Fill in credit card information (verification only, no charge) to complete the configuration
image.png

Create a tunnel

image.png

Click the Create a tunnel button in the red box in the figure below:
image.png

I plan to deploy this tunnel on a Tencent Cloud Lighthouse server, so I named the tunnel tencentcloud, and then click the save tunnel button in the red box in the bottom right corner:
image.png

Choose deployment method

Cloudflare's tunnel supports multiple environments: Windows, Mac, Debian, Red Hat, and Docker. You can choose according to your actual situation. I chose the Docker method. Actually, the Debian method also works, as my Tencent Cloud Lighthouse server is Debian, but the Docker method is cleaner and easier to maintain, which is my preferred method:

image.png

Copy the command in the red box in the figure above first. This command is incomplete and needs content added. The complete one is in the next section.

Create the Docker version of Cloudflare Connector on Tencent Cloud Lighthouse server

As a convention, first create the directory on the Tencent Cloud Lighthouse server that needs to be mapped into the container

mkdir -p /docker/cloudflare/data

Create the Docker version of the connector:

docker run --name cloudflare -d --restart=always \
-v /docker/cloudflare/data:/etc/cloudflared \
cloudflare/cloudflared:latest tunnel --no-autoupdate run --token xxxxxx

-v /docker/cloudflare/data:/etc/cloudflared \

image.png

Configure domain name and application URL

cloudflare/cloudflared:latest tunnel --no-autoupdate run --token xxxxxx

image.png

Please note that compared to the one copied from Cloudflare, the above command mainly adds the content of the first and second lines. If the -v parameter in the second line is not added, the status of my Cloudflare connector will be abnormal. The normal status of the connector is as follows:
image.png

On the Tunnel interface, select configure in the rightmost red box of the tencentcloud you just created:
image.png

Select in sequence: "Public Hostname" - "Public hostnames":
The following interface appears:
The 4 red boxes are the content we need to fill in. Assuming our domain name on Cloudflare is example.com, and the host we want to add is www, and the corresponding intranet IP address of the Tencent Cloud server is 10.0.0.3 (do not directly use the public IP of the cloud server, because the public IP of the cloud server is implemented through mapping, the server itself is a private address, and do not use 127.0.0.1, so you can only use the intranet IP address of the server), and the site port is 80, the information filled in is as follows:
Subdomain:www
Domain:example.com

Type :http

URL:10.0.0.3:80

Type uses the HTTP protocol, because Cloudflare will automatically provide HTTPS access to the outside.

image.png

If the Docker version of the connector is installed in the home broadband intranet, the URL can directly use the intranet address and port of the intranet site.
In fact, the result of this configuration is that an additional CNAME record with the host name www is added to the DNS of this domain name, and its record value is the tunnel ID of the tunnel:

Access

Similarly, multiple applications can be added.https://www.example.comNote: If the application specified by the URL above binds a host name, for example, if the application is Nginx and the site specifies server_name, then you need to add the corresponding domain name in Nginx's server_name according to the domain name configured earlier, which is www.example.com in the above example, otherwise it cannot be accessed normally.

View Related Categories · 3 Matches
📌 Content Structure Prompt:
This content is part of the following knowledge map, where you can view the complete content path: Cloudflare Learning Map。
📎 Related Articles
Share this article
The blog content is original, please indicate the source when reposting! The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if needed, you can join theTelegram Groupto discuss questions together.

Comments

  1. Direct use
    Windows to access intranet applications. Of course, for applications published using Cloudflare, direct access from mainland China will be relatively slow. I will discuss speed optimization in other articles later. However, generally speaking, if the main users are domestic users and have high requirements for experience, it is still better to get an ICP filing if possible. I currently have 2 domain names, one with an ICP filing, mainly for domestic users to access because it uses Tencent Cloud's CDN; the other domain name is placed on Cloudflare, mainly for overseas access, which can be regarded as a mutual backup of the two methods.
    2 years ago
    2024-9-14 16:59:32

    Xiaoyuer

    • Owner
      Direct use
      Macintosh Edge 128.0.0.0
      2 years ago
      2024-9-14 20:43:55

      May I ask if this method can further optimize the network speed, or is there a guide article for the next step? I am currently using the cftunnel+traefik solution to achieve intranet penetration + reverse proxy. Is there any room for further optimization? Thanks for your guidance!

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗ
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Kaomoji
Emoji
Little Dinosaur
Flower!
Previous
Next
       

👋 Welcome to “Wudi's Personal Blog”

Here, long-term exploration is mainly carried out around the following directions:

🧱 Personal Digital Infrastructure and Blog System Construction
☁️ Cloudflare and Network Architecture Practice
🧠 AI and Knowledge System Exploration
🛡️ Network Security and Access Optimization
🎵 Music and Sound Cognition
👁️ Cognitive Perspectives and Worldviews