Secure remote access to Proxmox VE with Cloudflare Tunnel
Remote access to a Proxmox VE host that has no public IP address, without opening a single port and without installing a client on the machine you connect from: a browser is enough. Three failed attempts, and a solution that combines Cloudflare Tunnel, Let's Encrypt via ACME and Cloudflare Access with two-factor authentication.
A project from my personal lab, which is currently paused: this write-up describes how it was built and how it worked.
Context
The aim was to be able to administer the Proxmox VE server in my personal lab remotely, from any machine with a browser. The environment had three conditions that, taken together, ruled out the usual solutions and forced me to look for a different architecture.
Failed attempts
Attempt 1 — Tailscale / WireGuard
tun module. Without it, any VPN solution based on virtual interfaces is unworkable — the kernel cannot create the virtual network interface it needs.
Attempt 2 — Reverse SSH tunnel with the VPS as a relay
With VPNs ruled out, the next option was a reverse SSH tunnel: Proxmox opens an outbound SSH connection to the VPS, the VPS exposes a port on localhost, and a second SSH tunnel is opened from the client machine to that port. This architecture does not require installing anything on the client machine (OpenSSH ships with Windows 10/11) and does not depend on special kernel modules.
It was implemented in full:
- A
tunneluser with no shell on both machines, used only for tunnels - A dedicated ed25519 key pair with restrictions in
authorized_keys autosshas a systemd service on Proxmox for automatic recoveryiptableson the VPS restricting the tunnel port to one authorised IP addressGatewayPorts noso the port is not reachable from the internet
192.168.x.x:8006, the packets never reached the destination — 100% packet loss from the VPS to any private IP address.
Attempt 3 — Cloudflare Tunnel (first try)
Cloudflare Tunnel exposes internal services through an outbound connection from an LXC container to Cloudflare's infrastructure, without opening ports on the router. It does not need a static public IP address, does not depend on the ISP, and does not require installing anything on the network you connect from.
cloudflared, which verifies the certificate of the service it delivers traffic to, rejected it: error 502. At first I put it down to Cloudflare's SSL mode (Full / Full (Strict)), but that setting governs Cloudflare's connection to an exposed origin: with a tunnel, the tunnel → Proxmox leg is verified by cloudflared and controlled by its noTLSVerify option. That option does exist in the Cloudflare Zero Trust dashboard (in the published application's additional settings, under TLS → No TLS Verify), but I did not find it at the time and tried the YAML configuration file route first. Even so, disabling verification leaves the tunnel → Proxmox leg unvalidated: the solution I ended up adopting (a valid certificate) keeps verification on.
- Changing the systemd service to use a YAML config with
noTLSVerify: true→ conflict with credentials (a token-based tunnel does not use a local credentials file) - Changing the SSL mode from
Full (Strict)toFull→ still 502: that mode does not affect the cloudflared → Proxmox leg, which is where the self-signed certificate was being rejected
Final solution
The final architecture combines three components that together solve what none of them solved on its own.
A dedicated LXC for cloudflared
First of all, a minimal LXC container dedicated solely to running cloudflared — separate from Proxmox and from every other service, so the tunnel does not depend on any other part of the lab. Everything to do with the tunnel is configured there: installing cloudflared, authenticating with Cloudflare, creating the tunnel and the public hostname that links it to Proxmox.
As it is the single point through which Proxmox is reached remotely, this container has to be up at all times — including straight after Proxmox itself reboots, with no manual intervention. That means enabling Start at boot (onboot: 1) in the container options.
Let's Encrypt certificate on Proxmox via ACME
A valid certificate is issued directly on Proxmox using Let's Encrypt's DNS-01 challenge with the Cloudflare plugin. This removes the self-signed certificate without having to expose port 80 to the internet.
The Cloudflare plugin automatically creates an _acme-challenge TXT record in DNS, Let's Encrypt verifies it and issues the certificate. Proxmox installs it and renews it automatically from day 60 of its life (the certificate lasts 90).
Cloudflare Tunnel with local DNS resolution
With a valid certificate, cloudflared can connect to Proxmox and verify the certificate, without disabling anything. However, a further problem appeared: when cloudflared tried to connect to proxmox.example.com:8006, DNS resolved to Cloudflare's public IP address (not Proxmox's local one), creating a loop.
Solution: an entry in /etc/hosts on the cloudflared container pointing the domain at Proxmox's local IP address. The certificate matches the hostname and the TLS connection validates correctly.
Cloudflare Access with two-factor authentication
In front of the tunnel, Cloudflare Access acts as the authentication layer with two mandatory rules (AND): a restriction to an authorised source IP address + a one-time passcode sent by email.
- The browser goes to
https://proxmox.example.com - Cloudflare Access intercepts → email screen
- The user enters their email address → receives a one-time passcode by email
- They enter the code → session valid for 24 hours
- They reach the Proxmox VE login with a valid certificate and no security warnings
Final architecture
Client machine (browser only) │ │ HTTPS port 443 ▼ Cloudflare Edge │ │ Cloudflare Access │ → checks authorised IP address │ → checks email one-time passcode ▼ Cloudflare Tunnel │ │ outbound connection initiated from the LXC │ no ports open on the home router ▼ cloudflared LXC /etc/hosts → Proxmox local IP │ │ HTTPS with a valid Let's Encrypt certificate ▼ Proxmox VE :8006 certificate: proxmox.example.com issuer: Let's Encrypt renewal: automatic via ACME + Cloudflare DNS plugin
Stack and security
Technology stack
| Hypervisor | Proxmox VE 9.2 (Debian 13) |
| Tunnel container | Debian 13 LXC, cloudflared 2026.6.1 |
| TLS certificate | Let's Encrypt via ACME (DNS-01) |
| DNS and CDN | Cloudflare (Free plan) |
| Authentication | Cloudflare Access (Zero Trust) |
| Hardware | 6th-gen Intel i5 · 16 GB RAM · 240 GB SSD |
Security layers
| No open ports | Cloudflare Tunnel (outbound connection) |
| Network restriction | Cloudflare Access: authorised IP address only |
| Authentication | Email one-time passcode, mandatory second factor |
| TLS encryption | Let's Encrypt on Proxmox, verified by cloudflared, TLS 1.3 |
| Limited session | Automatic expiry after 24 hours |
Extension: SSH terminal in the browser (ttyd)
Proxmox has its own management web interface, but the rest of the lab's machines (Linux LXC containers and VMs) are administered over SSH only. To reach them under the same requirement — a browser and nothing else, no client — I added a minimal LXC container running ttyd, a single-binary web terminal server, created with Terraform and configured with Ansible.
No new tunnel was needed: it is one more route on the existing Cloudflare Tunnel, with the same Cloudflare Access policy (authorised IP address + one-time passcode). Behind Access, ttyd runs login, not a shell: anyone who gets that far still has to authenticate as a real system user. There are two layers, and neither replaces the other.
The terminal would not accept any keystrokes
The page showed the login: prompt, but no characters got through. The warning had been in the start-up log from the beginning: The --writable option is not set, will start in readonly mode.
--writable to the service (ttyd -p 7681 --writable login). ttyd's read-only mode is meant for showing a session, not for administration; the security layers are still Access and login itself.
The public route went live before Access
After publishing the route, a curl -I check returned a straight 200, with no redirect: for that window, the login prompt was reachable without the Access layer. The tunnel and the Access application are two independent configurations in Cloudflare, and publishing the route does not create the policy.
curl -I after every change: it must return a 302 to cloudflareaccess.com, never a 200.
Lessons learned
/etc/hosts for TLS validation to work correctly.
Quick notes
A reference for maintaining this access, without having to rebuild the reasoning each time.
Create the cloudflared LXC and have it start on its own
To bring up the dedicated cloudflared container without installing everything by hand, I use the Proxmox VE Helper-Scripts script (community-maintained, formerly tteck). It runs from the Proxmox shell itself:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/cloudflared.sh)"
Script documentation: community-scripts.org/scripts/cloudflared. Once the container has been created, inside it: cloudflared tunnel login and cloudflared tunnel create <name> (or create the tunnel directly from the Cloudflare Zero Trust dashboard → Networks → Tunnels).
As this container has to be up at all times — including straight after Proxmox reboots — Start at boot must be enabled:
# From the Proxmox shell (replace <LXC_ID> with the real ID, e.g. 101): pct set <LXC_ID> --onboot 1 # Check that it has been enabled: pct config <LXC_ID> | grep onboot
Or from the GUI: select the container → Options tab → Start at boot → Edit → Yes.
Renew or force the certificate manually
Renewal is automatic, but if it needs checking or forcing:
# Show the status and expiry date of the active certificate: pvenode cert info # Force a manual renewal via ACME: pvenode acme cert renew
Check the Cloudflare tunnel from the LXC
# Status of the cloudflared service: systemctl status cloudflared # Confirm that /etc/hosts resolves to the local Proxmox, not to Cloudflare: cat /etc/hosts | grep proxmox.example.com
If Cloudflare Access does not let the passcode through
Check, in the Cloudflare Zero Trust dashboard → Access → Applications, that the authorised IP rule still points to the current public IP address of the network you connect from (it can change if its ISP does not provide a static address).