Cloudron is designed to run on a server with a public IP address, with ports 80 and 443 open to the internet. My Cloudron runs on a virtual machine on SWHV01, my home server. I did not want to open ports on my router for it.
So instead of exposing Cloudron directly, I put a proxy in front of it: Cloudflare Tunnel. In this guide, I’ll walk you through how it fits together.
๐งฐ What You’ll Need
- A server or VM running Cloudron
- A domain using Cloudflare for DNS
- A Cloudflare account (the free tier is enough)
โ๏ธ How It Works
A small program called cloudflared runs on the same VM as Cloudron. It makes an outbound connection to Cloudflare and keeps it open. There is no listening port for the internet to connect to.
Each public hostname โ the Cloudron dashboard and every app โ is advertised on the tunnel. When a request comes in, Cloudflare receives it and sends it down the tunnel to cloudflared, which passes it to Cloudron on the VM itself.

This gives me two things:
- No open ports. My router forwards nothing. The only connections are outbound, started by the VM.
- Shared ports. The dashboard and all my apps share the one tunnel and Cloudron’s single HTTPS port. Each new app is just another hostname on the tunnel โ no new ports, no extra public IP addresses.
I compared Tailscale and Cloudflare Tunnel in an earlier post. This is the setup I chose for services that other people need to reach.
โ๏ธ Step 1: Install cloudflared on the Cloudron VM
Install cloudflared on the same VM that runs Cloudron:
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o cloudflared
sudo install -m 755 cloudflared /usr/local/bin/cloudflared
cloudflared --version
โ๏ธ Step 2: Create the Tunnel
Log in and create a tunnel. The login step opens a browser to authorise the domain:
cloudflared tunnel login
cloudflared tunnel create cloudron
Note the tunnel ID that is printed. You will need it for the configuration file.
โ๏ธ Step 3: Configure the Hostnames
Create ~/.cloudflared/config.yml:
tunnel: <TUNNEL-ID>
credentials-file: /root/.cloudflared/<TUNNEL-ID>.json
ingress:
- hostname: my.example.com
service: https://localhost:443
originRequest:
noTLSVerify: true
- hostname: "*.example.com"
service: https://localhost:443
originRequest:
noTLSVerify: true
- service: http_status:404
Two things to note:
- The dashboard rule comes first.
cloudflareduses the first matching rule, somy.example.comis listed before the wildcard that catches the apps. noTLSVerifyskips checking Cloudron’s certificate. The connection betweencloudflaredand Cloudron never leaves the VM, and visitors still get a valid certificate from Cloudflare at the edge.
โ๏ธ Step 4: Advertise the Public Hostnames
A hostname only reaches the tunnel once its DNS record points at it:
cloudflared tunnel route dns cloudron my.example.com
For the wildcard, add a CNAME record for * in the Cloudflare DNS dashboard, pointing to <TUNNEL-ID>.cfargotunnel.com.
This is the “advertising” step: the public hostname exists in DNS, but it resolves to the tunnel โ not to my home IP address, which is never exposed.
โ๏ธ Step 5: Run It as a Service
sudo cloudflared service install
sudo systemctl enable --now cloudflared
The tunnel now starts on boot and reconnects on its own.
โ๏ธ Step 6: Point Cloudron at the Domain
In Cloudron, add the domain so the dashboard lives at my.example.com and apps get their own subdomains. Choose the Wildcard or Manual DNS option, not the Cloudflare API one: an API provider makes Cloudron write A records pointing at this machine’s IP address, which fights the tunnel’s CNAME records. With Wildcard or Manual, Cloudron leaves DNS alone, and the tunnel records stay yours to manage.
Cloudron does not need to know the tunnel exists โ as far as it is concerned, requests simply arrive at its HTTPS port.
โ ๏ธ Two honest caveats. First, mail does not travel through the tunnel: Cloudflare only proxies web traffic โ Cloudron’s own documentation says the same โ so if you use Cloudron’s built-in mail server, those ports still need their own arrangement. Second, certificates: with the Wildcard or Manual DNS option, Cloudron validates Let’s Encrypt certificates over HTTP on port 80, which assumes the server can be reached directly. If renewals ever complain, a DNS-validated or custom wildcard certificate avoids that check.
โ You’re Done
Cloudron now runs at home, on a VM, with nothing exposed:
- No ports forwarded on the router
- Every app reachable on its own public hostname
- One tunnel to manage, instead of a list of port forwarding rules
๐ ๏ธ Don’t Want to Do This Yourself?
I can set this up for you, remotely, on your own server or NAS โ configured the same way as in this guide โ for a small fee. Email me at hello@alwynsoh.com, or message me on Ko-fi, and we’ll work out the details.
If this guide helped you, consider buying me a coffee:
๐ https://ko-fi.com/alwynsoh
Every tip helps me keep testing, writing, and sharing guides like this. Appreciate the support!


