Skip to main content

Prerequisites

A Cloudflare Tunnel is required before proceeding with the installation. This should already be set up, but if not, log in to your Cloudflare Dashboard and navigate to Zero Trust → Networks → Tunnels to create a new tunnel.

This tunnel will serve as the primary gateway for all services running within the Homelab.
Before you can use Cloudflare Tunnels, a Cloudflared LXC container must be running on your homelab. This should already be set up, but if not, navigate to Homelab → Shell and execute the following script:
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/cloudflared.sh)"
During the installation process, you will be prompted to configure Cloudflared as a DNS-over-HTTPS (DoH) proxy. It is NOT recommended to enable this option, as it may cause conflicts with other applications.
Once the installation is complete, you should see a new VM named (cloudflared). Right-click on it and open the console to proceed with the setup.

To connect the tunnel, return to your Cloudflare Zero Trust Dashboard and navigate to Networks → Tunnels → TUNNEL_NAME → Configure → Overview → Debian → 64-bit. Copy the second command and paste it into the console to finalize the setup.The command should resemble the following:
sudo cloudflared service install TUNNEL_KEY

Connecting a VM

To connect a VM to the tunnel, navigate to your Cloudflare Zero Trust Dashboard and go to Networks → Tunnels → TUNNEL_NAME → Configure → Public Hostname → Add a public hostname.

Here, you can create a new hostname and assign it to a specific VM. Set the Type to HTTP or HTTPS. The URL should correspond to the IPv4 address and Port of the VM you want to connect.