Skip to content

Instantly share code, notes, and snippets.

@Zeko369
Last active February 6, 2026 10:23
Show Gist options
  • Select an option

  • Save Zeko369/8f6dac0e1c2ea03544060117485517ad to your computer and use it in GitHub Desktop.

Select an option

Save Zeko369/8f6dac0e1c2ea03544060117485517ad to your computer and use it in GitHub Desktop.
Setting up a Cloudflare Tunnel for local development

Setting up a Cloudflare Tunnel for local development

Prerequisites

  • Install cloudflared: brew install cloudflared
  • Have access to the Cloudflare account for the unidy.de domain

One-time setup

1. Authenticate with Cloudflare

cloudflared tunnel login

This opens a browser to select the unidy.de zone.

2. Create a named tunnel

cloudflared tunnel create my-demo

Note the tunnel ID from the output.

3. Create the DNS record

cloudflared tunnel route dns my-demo my-demo.unidy.de

4. Create config file at ~/.cloudflared/config.yml

tunnel: my-demo
credentials-file: /Users/<username>/.cloudflared/<tunnel-id>.json

ingress:
  - hostname: my-demo.unidy.de
    service: http://localhost:4321
  - service: http_status:404

Running the tunnel

In one terminal, start your dev server:

bun run dev

In another terminal, run the tunnel:

cloudflared tunnel run my-demo

Your local site is now accessible at https://my-demo.unidy.de

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