Farewell to Filing and High-Cost VPS: My Zero-Cost Website Practice with Cloudflare Tunnel
Introduction
In the digital age, building a personal website seems like a dream for every tech enthusiast. Yet, the realities are often harsh: expensive international VPS options, and the mandatory, complicated ICP filing process for domestic VPS.
Through extensive experimentation, I discovered a solution that is practically “zero-cost,” completely avoids the filing hassle, and delivers powerful performance—using Cloudflare Tunnel. If you are tired of high server fees and complex administrative processes, this article is for you.
Phase 1: Breaking the Cost Barrier—Domain and CDN Choices
The first step in building a website is managing the domain and the Content Delivery Network (CDN). Our goal is maximum value and global performance.
1. Domain Management: From Overpaying to “Free Riding”
My first step was moving my domain management entirely to Cloudflare.
This decision was not just a cost liberation; more importantly, it became the cornerstone for all my subsequent low-cost strategies. Cloudflare provides:
- Free and robust DNS services.
- Powerful API integration, paving the way for automation.
2. CDN Acceleration: Free and High-Performance Global Network
For content distribution, I immediately opted for Cloudflare’s Free CDN.
- Exceptional Performance: Cloudflare boasts a powerful global network of nodes, ensuring your website offers a lightning-fast experience worldwide.
- Integrated Functionality: It integrates seamlessly with domain management, requiring no extra configuration. It is the best free acceleration solution for international or global websites.
Phase 2: The Ultimate Server Solution—“Home IP” + Tunnel
This is the most innovative and cost-effective part of the entire plan, completely solving the two major dilemmas of traditional VPS deployment:
| Traditional VPS Pain Point | Description |
|---|---|
| International VPS | Generally expensive, or cheap options offer poor performance. |
| Domestic VPS | Mandatory ICP filing required, a complex and time-consuming process. |
My solution: Domestic Self-Hosted Server (or idle device) + Cloudflare Tunnel.
Cloudflare Tunnel: The Zero-Config Internal Network Penetration Tool
Cloudflare Tunnel allows you to securely and cryptographically expose services running on your local network (e.g., Nginx running on your home computer) to the public internet without needing a public IP address or configuring complex port forwarding.
💡 Key Advantage: The free tier of Tunnel solves the two major issues of domestic hosting—lack of a public IP and the need for ICP filing—allowing me to utilize a low-power, idle device at home as my production server.
Phase 3: Deployment Practice and Technical Details
From theory to practice, there are several key technical details to note during deployment:
1. Containerized Deployment: Keeping Everything Simple and Migratable
To ensure the flexibility and portability of the website, I chose Docker.
I used Docker to launch the Nginx container and had it listen on local port 8001. This ensures my entire website architecture is highly containerized, easy to manage, and simple to back up.
$$ \text{Public Domain} \longrightarrow \text{Cloudflare DNS/CDN} \longrightarrow \text{Tunnel} \longrightarrow \text{Local Host} \longrightarrow \text{Docker Nginx} (\text{Port 8001}) $$
2. The Critical “Tunnel Mapping Pitfall”
When configuring Cloudflare Tunnel to map my domain to the local service, I encountered a minor issue:
⚠️ Solution: In the Cloudflare DNS panel, you must first delete any old
AorCNAMErecords for the domain before you can successfully enter the domain into the Tunnel configuration and securely map it to the local service (e.g.,localhost:8001).
3. Instant Go-Live Strategy
With the website infrastructure now complete, I adopted an “Develop Locally, Go-Live Instantly” strategy:
- Local Build: Directly deploy and test my website application (like Hugo or WordPress) inside the Docker Nginx container.
- Local Testing: Ensure the website functions perfectly on
localhost:8001. - Instant Deployment: Since the entire service is exposed via the Tunnel, once the local container is running, public users can immediately access the site via the domain—no extra deployment steps required!
Conclusion: Zero Cost, High Efficiency
My experience demonstrates that the choice of technical solution can profoundly impact the cost and efficiency of building a website.
If you are looking for a website that is:
- Filing-Exempt
- Zero-Server-Cost (using idle equipment)
- Globally Accelerated
The combination of Cloudflare Tunnel + Docker + Idle Device is absolutely the “free-riding” website-building tool you cannot afford to miss!
Resources & Tools
- Cloudflare: Domain, CDN, Tunnel (https://www.cloudflare.com)
- Docker: Containerization Tool (https://www.docker.com)
- Nginx: Lightweight Web Server (https://nginx.org)
- Reference: Special thanks to Gemini for the inspirational ideas!