NEWUse coupon code SMX20 to get 20% OFF your first billing cycle on any game server or VPS!Explore Store

VPS HOSTING

VPS Hosting for Cloudflare Tunnel Applications

Use Cloudflare Tunnel (cloudflared) on a VPS: outbound-only connections, publishing web apps without opening ports, ingress rules, Cloudflare Access for login, SSH through the tunnel, limitations, high availability and when to use it.

Publishing an application normally means opening ports 80 and 443, managing certificates and exposing the server's IP address. Cloudflare Tunnel turns that around: the server connects out to Cloudflare, and Cloudflare forwards requests through that connection. The result is fewer open ports, a hidden origin and an easy place to add authentication. This guide covers when and how to use it on a VPS.

How It Works

user ─▶ Cloudflare edge (TLS, WAF, Access login)
                 │  (tunnel connections initiated by the server)
VPS: cloudflared ─▶ localhost:3000 app
                  ─▶ localhost:8080 dashboard

cloudflared keeps several outbound connections to Cloudflare. Requests for configured hostnames travel through them to local services. Because connections are outbound, the firewall can block all inbound traffic except what you choose to keep, such as SSH for emergencies.

Setup Outline

  1. Add your domain to Cloudflare.
  2. Create a tunnel in the Cloudflare dashboard (or with the cloudflared CLI) and install cloudflared on the VPS with the tunnel token.
  3. Run cloudflared as a service so it starts on boot.
  4. Configure public hostnames or ingress rules that map each hostname to a local service.
  5. Bind your applications to localhost so they are reachable only through the tunnel.

Ingress Rules

Ingress rules map hostnames and paths to services: HTTP services on local ports, Unix sockets, or other internal addresses. End with a catch-all rule that returns 404 so unknown hostnames do not reach anything unexpectedly. Keep the configuration in version control.

Adding Login With Cloudflare Access

For internal tools (dashboards, admin panels, staging sites), put Cloudflare Access in front of the hostname: users authenticate with your identity provider or one-time codes before requests reach the tunnel. Define policies per application, for example only your company email domain or specific groups. This is a simple way to apply zero trust principles to web tools.

SSH and Other TCP Services

You can expose SSH through a tunnel hostname and connect with the cloudflared client as an SSH proxy, protected by Access policies. This lets you close port 22 to the internet. Keep a provider console path for emergencies in case the tunnel or Cloudflare account is unavailable.

Lock Down the Origin

  • Bind applications to 127.0.0.1.
  • Block inbound HTTP and HTTPS at the firewall if everything goes through the tunnel (see our UFW guide).
  • Do not publish the server IP in DNS records for tunnelled hostnames.
  • Remember Docker-published ports can bypass UFW; publish containers on localhost.

Limitations

  • Designed mainly for HTTP(S) and TCP services; game servers that need direct UDP from players are not a good fit.
  • All traffic depends on Cloudflare's service and your account configuration.
  • Large file uploads and long-lived connections should be tested against Cloudflare's limits for your plan.
  • Cloudflare terminates TLS at its edge, which is acceptable for most uses but should be considered for sensitive data.

High Availability

A single cloudflared instance is a single point of failure for the tunnel. Run cloudflared replicas on more than one server for the same tunnel, or at least monitor the service and restart it automatically. The applications behind the tunnel still need their own redundancy.

When to Use a Tunnel vs Opening Ports

SituationBetter approach
Internal admin tools and dashboardsTunnel with Access
Public website already on CloudflareTunnel or proxied DNS with origin firewall
Game server, VoIP, UDP servicesDirect ports with provider DDoS protection
Server-to-server private trafficMesh VPN such as Headscale

Example: Securing Internal Dashboards

A startup runs Grafana, an admin panel and a staging site on one VPS, all bound to localhost. A Cloudflare Tunnel maps three hostnames to them, Cloudflare Access requires company Google login, and SSH goes through the tunnel too. The VPS firewall now blocks all inbound connections except its provider's management access.

Common Mistakes

  • Leaving apps listening on public interfaces, bypassing the tunnel.
  • No catch-all rule in the ingress configuration.
  • Exposing internal tools through the tunnel without Access policies.
  • Expecting UDP game traffic to work like HTTP.
  • No emergency access path if the tunnel fails.

In Short

Cloudflare Tunnel publishes HTTP and TCP services through outbound connections, hides the origin and pairs naturally with Access for login. Bind apps to localhost, close inbound ports, add Access policies, plan for redundancy and use direct ports for UDP-heavy services. For layered defences, see our firewall vs DDoS guide.

Monitoring the Tunnel

Watch cloudflared's service status and logs, the tunnel's health in the Cloudflare dashboard, and the applications behind it. Alert when the tunnel disconnects or a hostname starts returning errors. Because users reach your apps only through the tunnel, a stopped connector looks like a full outage, so restart it automatically and test failover if you run replicas. Review Access logs periodically to see who used each internal tool.

Next Steps

Move one internal tool behind a tunnel with Access, bind it to localhost, close its public port, then repeat for the rest. Security controls only help if they keep working, so schedule a short quarterly review: confirm who still has access, apply pending updates, test that backups restore and check that nothing you closed has quietly been reopened by a later change. Document each step as you go, including the reasons for every rule and exception, so colleagues can maintain the setup confidently and auditors or customers can see how access is controlled.

ServoMix Plans for This Workload

cloudflared itself is light; size the VPS for the applications behind it. 2 vCores / 8 GB suits a few internal tools; busier apps need their usual resources.

AMD EPYC 7C13 VPS

Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
SMX vPro XS (AMD EPYC)28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹420/moWebsites, small APIs, bots, staging and VPN serversOrder
SMX vPro S (AMD EPYC)416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹560/moWooCommerce, Node.js/Python backends, Docker Compose stacks, CI runnersOrder
SMX vPro M (AMD EPYC)832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹840/moProduction databases, high-traffic sites, multi-container appsOrder
SMX vPro L (AMD EPYC)1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹1,120/moLarge production workloads, SaaS platforms, analytics, in-memory cachesOrder

Intel Xeon Platinum 8269CY VPS

KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
SMX vCore XS (Intel Xeon)28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹270/moBusiness websites, small apps, scheduled jobs and botsOrder
SMX vCore S (Intel Xeon)416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹1,169/monthBusiness software, mid-size databases, several sites on one serverCheck stock
SMX vCore M (Intel Xeon)832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹2,249/monthERP/CRM stacks, heavier databases, multiple production appsCheck stock
SMX vCore L (Intel Xeon)1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹4,248/monthHigh-memory workloads and consolidated production serversCheck stock

Prices are monthly in INR as listed on the ServoMix store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.

Frequently Asked Questions

What is Cloudflare Tunnel?
A service where cloudflared on your server connects outbound to Cloudflare, which forwards requests for your hostnames to local services.
Do I need to open ports for Cloudflare Tunnel?
No inbound ports are needed for tunnelled services.
Does a tunnel hide my server's IP?
Yes, if you do not publish the IP elsewhere and apps are not reachable directly.
What is Cloudflare Access?
An authentication layer that requires login before users reach an application behind Cloudflare.
Can I use SSH through Cloudflare Tunnel?
Yes, with the cloudflared client acting as an SSH proxy, protected by Access.
Can I run a game server through a tunnel?
Game servers needing direct UDP from players are not a good fit; use direct ports with DDoS protection.
Is cloudflared a single point of failure?
It can be; run replicas on multiple servers or monitor and restart it.
Why bind apps to localhost?
So they can only be reached through the tunnel, not directly.
Does Docker bypass the tunnel?
Docker-published ports can be exposed publicly; publish them on localhost.
Which plan suits tunnelled apps?
Size for the applications; 2 vCores / 8 GB suits a few internal tools.

Frequently Asked Questions

What is Cloudflare Tunnel?

A service where cloudflared on your server connects outbound to Cloudflare, which forwards requests for your hostnames to local services.

Do I need to open ports for Cloudflare Tunnel?

No inbound ports are needed for tunnelled services.

Does a tunnel hide my server's IP?

Yes, if you do not publish the IP elsewhere and apps are not reachable directly.

What is Cloudflare Access?

An authentication layer that requires login before users reach an application behind Cloudflare.

Can I use SSH through Cloudflare Tunnel?

Yes, with the cloudflared client acting as an SSH proxy, protected by Access.

Can I run a game server through a tunnel?

Game servers needing direct UDP from players are not a good fit; use direct ports with DDoS protection.

Is cloudflared a single point of failure?

It can be; run replicas on multiple servers or monitor and restart it.

Why bind apps to localhost?

So they can only be reached through the tunnel, not directly.

Does Docker bypass the tunnel?

Docker-published ports can be exposed publicly; publish them on localhost.

Which plan suits tunnelled apps?

Size for the applications; 2 vCores / 8 GB suits a few internal tools.

Was this article helpful?

Your feedback helps us continuously improve ServoMix guides.

Share this article

Know someone who may find this guide useful?

Cloudflare Tunnel on a VPS: Publish Apps Without Open Ports | ServoMix