How to Share Local Networks Online Using Cloudflare Tunnels

#cloudflare

A Cloudflare tunnel enables a local network to be accessible over the internet, useful for sharing a development environment, without any complexity of a VPN or port-forwarding.

Creating a tunnel

  1. Login to Cloudflare dashboard
  2. Navigate to Zero Trust -> Networks -> Tunnels
  3. Create a tunnel using “cloudflared”
  4. Install the tunnel connector if not already installed, e.g. brew install cloudflared
  5. Follow the wizard in the Cloudflare dashboard to setup the connector, e.g. sudo cloudflared service install eyJh...
  6. Configure a public hostname for how the service will be accessible, linked to a domain using Cloudflare DNS.
  7. Run cloudflared tunnel run <tunnel-name> locally to start the connector and have access.

Warning!

The site will be publicly accessible on the subdomain to everyone. See TIL: Setting up Cloudflare Zero Trust Applications and Policies for access control to enable an access control list.

Top