This content originally appeared on DEV Community and was authored by MUHAMMAD ARBAB ANJUM
Install cloudflared
Download from: https://github.com/cloudflare/cloudflared/releases
Change Dir
cd C:\cloudflared\
Login to Cloudflare
cloudflared tunnel login
Create tunnel
cloudflared tunnel create nextjs-tunnel
Route DNS
cloudflared tunnel route dns nextjs-tunnel test.myworkly.com
Create config.yml file in C:\cloudflared\config.yml
tunnel: nextjs-tunnel
credentials-file: C:\Users\%USERNAME%\.cloudflared\[your-tunnel-id].json
ingress:
- hostname: test.domain.com
service: http://localhost:3000
- service: http_status:404
Quick Test
cloudflared tunnel --hostname test.domain.com --url http://localhost:3000
Run tunnel pointing directly to Next.js
cloudflared tunnel --config config.yml run nextjs-tunnel
This content originally appeared on DEV Community and was authored by MUHAMMAD ARBAB ANJUM

MUHAMMAD ARBAB ANJUM | Sciencx (2025-08-25T23:41:55+00:00) Expose localhost to the network using Cloudflare Tunnel. Retrieved from https://www.scien.cx/2025/08/25/expose-localhost-to-the-network-using-cloudflare-tunnel/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.