How to Share Local Networks Online Using Cloudflare Tunnels
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
- Login to Cloudflare dashboard
- Navigate to Zero Trust -> Networks -> Tunnels
- Create a tunnel using “cloudflared”
- Install the tunnel connector if not already installed, e.g.
brew install cloudflared - Follow the wizard in the Cloudflare dashboard to setup the connector, e.g.
sudo cloudflared service install eyJh... - Configure a public hostname for how the service will be accessible, linked to a domain using Cloudflare DNS.
- 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.