Everything you need to know to get securely connect to your locally hosted application over the internet in under 30 mins.
At the high level, I’m running a SimpleHTTPServer locally, that i want to access over the internet from https://home.mydomainname.com
Secondly, I’ll lock down the access to this URL to whitelisted email addresses.
Before you start, make sure you:
cloudflared
wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
dpkg -i cloudflared-linux-amd64.deb
cloudflared tunnel login
cloudflared tunnel create <NAME>
this will spit out a <UUID>.json
file in your ~/.clouflared
DIR
tunnel: <Tunnel-UUID>
credentials-file: /root/.cloudflared/<Tunnel-UUID>.json
ingress:
- hostname: home.mydomainname.com
service: http://localhost:65000
- service: http_status:400
cloudflared tunnel run <UUID or NAME>
visiting the URL now should route traffic to your local service
Note:
Cloudflare Access determines who can reach your application by applying the Access policies you configure.
Cloudflare Zero Trust integrates with your organization’s identity provider to apply Zero Trust and Secure Web Gateway policies.
In this example, I’m using As an alternative to configuring an identity provider, Cloudflare Zero Trust can send a one-time PIN (OTP) to approved email addresses.
A group is a set of rules that can be configured once and then quickly applied across many Access applications
An Access policy consists of an Action as well as rules which determine the scope of the action.
visiting the URL now should present you with a login page
You can monitor traffic in Analytics & Logs from the Cloudflare dashboard.
Official Cloudflare Documentation Follow this step-by-step guide to get your first tunnel up and running using the CLI.
Set Up a Cloudflare Tunnel to Expose Local Servers to the Internet