Skip to main content

How to Set up CloudFlare Tunnels in 2025

Introduction

A Cloudflare Tunnel creates a secure, outbound-only connection between your home network and Cloudflare’s global network. It enables exposing services running on your homelab without opening ports or complex firewall adjustments. This simplifies remote access from anywhere.

⚠️

Important

It is recommended to install the Cloudflare Tunnel on a dedicated VM, although you can install it on an existing VM as shown in this tutorial.

Creating a Cloudflare Tunnel

  1. Visit Cloudflare.com and log in (Google account option available).
Cloudflare dashboard
  1. Purchase a domain if you don't have one already (around $11/year).
Cloudflare buy domain
  1. Navigate to Zero Trust in the sidebar.
Cloudflare Zero Trust
  1. Go to Networks, then Tunnels.
Cloudflare Tunnels
  1. Click Add a Tunnel.
Add a tunnel
  1. Select the recommended Cloudflared option.
Cloudflared option
  1. Name your tunnel.
Name your tunnel
  1. Choose your OS (e.g., Debian).

  2. Copy the installation commands given.

  3. SSH into your chosen VM:

ssh <username>@<server_ip>

Paste and run the installation commands.

SSH into VM Tunnel install commands
  1. Verify the tunnel connection is established.
Tunnel connected
  1. Create a route for your service by selecting subdomain, domain, and entering service protocol + local IP (e.g., KASM using HTTPS on local VM IP).
Configure service tunnel
  1. Edit the tunnel settings (click three dots → edit), under Additional Application SettingsTLS, enable No TLS Verify, then save.
Tunnel TLS settings Enable No TLS Verify
  1. Finally, access your service via the created public URL.
Access service via tunnel

Follow Us on Social Media

YouTube
Discord
Patreon
Reddit
Rumble

Previous Video