Skip to content

Instantly share code, notes, and snippets.

@kittinan
Last active December 20, 2021 04:40
Show Gist options
  • Save kittinan/a64d6ffc0d61236af5c7ec493615ce64 to your computer and use it in GitHub Desktop.
Save kittinan/a64d6ffc0d61236af5c7ec493615ce64 to your computer and use it in GitHub Desktop.
Cloudflare tunnel

Anonymous tunnel

cloudflared tunnel --url localhost:8000

With your own sub domain

  • login and select domain
cloudflared tunnel login
  • Create tunnel name
cloudflared tunnel create <NAME or UUID>
  • Create config.yml in your home path ~/.cloudflared/config.yml
url: http://localhost:8000
tunnel: <NAME or UUID>
credentials-file: /home/null/.cloudflared/YOUR_TUNNEL_CREDENTIAL_FILE.json
  • Map tunnel to your hostname/subdomain
cloudflared tunnel route dns <tunnel name/id> <hostname>"
  • Run tunnel
cloudflared tunnel run <tunnel name>
  • Run tunnel specific port
cloudflared tunnel run --url localhost:3000 <tunnel name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment