Quick Start
Create your first tunnel in 2 minutes
Go from nothing installed to a public URL forwarding to your local server in under 2 minutes.
Install
If you haven't already, install the CLI (a single binary; on Linux it needs glibc 2.28 or newer):
# macOS / Linux
curl -fsSL https://zgrok.io/install.sh | sh# Windows (PowerShell)
irm https://zgrok.io/install.ps1 | iexVerify it worked:
zgrok --versionSee Installation for manual downloads and platform binaries.
Pick your framework
Pick what you are running to see its run command, its default port and the one setting most frameworks need before they accept a tunnel. If the port differs from 3000, use it in step 2 instead of 3000.
Let Vite accept the tunnel's address
Blocked request. This host ("quiet-river--acme-shop.zgrok.io") is not allowed.export default defineConfig({
server: {
allowedHosts: [".zgrok.io"],
},
});Since early 2025 Vite refuses unknown Host headers by default. The leading dot allows every zgrok address, which matters because free addresses change.
Start your app, then the tunnel
# terminal 1
npm run dev
# terminal 2
zgrok http 5173Sign in
zgrok loginThe CLI prints a short code and opens your browser. Check that the code matches, approve it, and the CLI saves an API key to ~/.zgrok/config.yaml. You only do this once on each machine.
On a machine with no browser, such as over SSH, it prints the URL instead, so you can approve from any device. zgrok login --no-browser does the same anywhere.
1. Start your local server
Make sure you have a local server running. For example:
# Node.js
npx serve -p 3000
# Python
python -m http.server 3000
# Any framework (Next.js, Rails, Django, etc.)
# Just make sure it's running on a port2. Start a tunnel
zgrok http 3000You'll see the tunnel come online, then each request as it arrives:
Text version
$ zgrok http 3000zgrok v0.30.1→ Connecting to relay.zgrok.io:4433...→ Authenticating...Tunnel Status: onlineProject: acme-shop (switch: zgrok project)Forwarding: https://bnu5xt--acme-shop.zgrok.io → http://localhost:3000temporary address: replaced after 24 hours, or when you restart zgrokkeep an address: https://zgrok.io/pricingRequests: https://zgrok.io/dashboard/tunnels/ucy3gbytcd6z7ky0mprkq7wy/logsInspect: http://127.0.0.1:4040→ Press Ctrl+C to stop the tunnel[00:27:05] GET / 200 2ms[00:27:06] GET /api/products 200 2ms[00:27:06] POST /webhooks/payments 200 1ms[00:27:07] POST /api/orders 422 1ms[00:27:07] POST /api/orders 201 2ms[00:27:08] GET /favicon.ico 404 1ms
Requests opens this tunnel's log in your dashboard, for when you need to scroll back further than the terminal.
Inspect is the request inspector, running on your own machine: every request through the tunnel with its full headers and body, and a button to replay any of them against your local app. It runs by default; --no-inspect turns it off.
3. Access your tunnel
Open the Forwarding URL in any browser. Your local server is now accessible from the internet. To test it from your phone, add --qr and scan the code zgrok prints instead of typing the URL:
zgrok http 3000 --qr4. Name your tunnel
Every tunnel lives inside one of your projects, and its address is the tunnel's name followed by the project: a7f9x2--acme-shop.zgrok.io is the tunnel a7f9x2 in the project acme-shop. By default zgrok assigns a random name, and on Free it changes every time you start a tunnel. Name your tunnels inside your project with --subdomain:
zgrok http 3000 --subdomain apiYour tunnel is now reachable at https://api--acme-shop.zgrok.io, which is useful for a webhook URL you don't want to re-register every restart. Custom tunnel names are a PRO plan feature; see Plans & Limits for details.
Your dashboard lists every tunnel in the project, live or not, with the requests each one received:
5. Inspect requests
As requests come in, they're printed in your terminal in real time:
[14:32:05] GET / 200 12ms[14:32:06] POST /api/webhook 200 45ms[14:32:07] GET /assets/style.css 304 3ms
Method, status, and latency are all color-coded for quick scanning. See Request Logging for the full format and how to turn it off with --no-log.
6. Stop the tunnel
Press Ctrl+C to gracefully disconnect:
→ Shutting down tunnel...✓ Tunnel disconnected gracefully
Troubleshooting your first run
- "Connection failed" on startup: check
nslookup relay.zgrok.io; if you're behind a corporate firewall, QUIC (UDP port 4433) may be blocked. - "API key required": run
zgrok login, or pass--api-key/ setZGROK_API_KEYfor a single run. - 502 from your tunnel URL: your local server isn't running on the port you passed to
zgrok http.
Full list of fixes: Troubleshooting.
What's next?
- Custom Headers: inject CORS headers
- Configuration: set default port and tunnel name
- CLI Reference: all commands and flags

