Local Hosting

Sharing with Cloudflare Quick Tunnels

Use a Cloudflare Quick Tunnel to give attendees a public URL for an application running on a locally hosted instance, without an account.

3 min

Overview

A locally hosted instance is only reachable from your own machine or network. Attendees, Splunk Synthetic Monitoring tests, and anyone outside your network cannot open http://localhost:81 or a private address such as http://192.168.205.185:81.

Cloudflare Quick Tunnels create a temporary public trycloudflare.com URL that forwards to a port on your machine. No Cloudflare account or domain is required.

The workshop application listens on port 81 on every local hosting option:

Hosting optionApplication address from your machine
Dockerhttp://localhost:81
Multipasshttp://<instance-ip>:81
OrbStackhttp://<instance-ip>:81
Proxmoxhttp://<vm-ip>:81

Warning

Anyone with the Quick Tunnel URL can reach the application for as long as the tunnel is running. Only share it with attendees, and stop the tunnel when the workshop ends.

Install cloudflared

Install cloudflared on the machine that runs the instance. On a Mac:

bash
brew install cloudflared

On Windows and Linux, download the latest release from the cloudflared downloads page .

Start the tunnel

Confirm the application loads in your own browser first, then start the tunnel against the same address.

bash
cloudflared tunnel --url http://localhost:81

cloudflared prints a trycloudflare.com URL. Open it to confirm the application loads, then share it with attendees.

Keep the terminal open. Closing it, or pressing Ctrl+C, stops the tunnel and the URL stops working.

Info

The hostname changes every time a Quick Tunnel is created. If you restart the tunnel, send attendees the new URL. For a stable hostname, use ngrok , whose dev domain stays the same across restarts, or create a Cloudflare Tunnel .

Restrict access by email

Add --allowed-mail to require visitors to verify their email address with a one-time PIN before they reach the application. Visitors do not need a Cloudflare account.

Allow every address from an email domain. Quote wildcard values so the shell does not expand them:

bash
cloudflared tunnel --url http://localhost:81 --allowed-mail '*@example.com'

Allow specific addresses by repeating the flag or using a comma-separated list:

bash
cloudflared tunnel --url http://localhost:81 \
  --allowed-mail 'alice@example.com,bob@example.com'

To change who has access, stop cloudflared and start a new Quick Tunnel, which has a new URL. Access ends for everyone when the process stops.

Warning

Email authentication needs an interactive browser session. Splunk Synthetic Monitoring tests and other automated clients cannot pass it, so leave --allowed-mail off if the workshop uses synthetic tests against the application.

Limitations

Quick Tunnels are intended for testing and development:

Stop the tunnel

Press Ctrl+C in the terminal running cloudflared. The public URL stops working immediately for everyone.

Troubleshooting

Last Modified ·

Report an issue