Sep 9, 2025
The ngrok cheatsheet
Getting started with ngrok is almost suspiciously easy. Which is why the question we hear most often isn’t “where do I start?” but rather “what else can I do with ngrok?” For over a decade, we’ve been serving millions of developers and, through them, millions of users.
Sure, our documentation has all the answers, every CLI flag, every Traffic Policy configuration neatly laid out, but what about the developers who are always on the lookout for a TL;DR? What if you too are not looking for a full solution or a specific use case for your next project, but just want to know… what else **you** can do with ngrok?
Presenting ngrok’s new cheatsheet that walks you through some of our most interesting offerings, designed to scratch that itch of not just serving, but also securing endpoints in as little as two steps. Read on or download the crisp two-pager printable in PDF.
Installation
- Sign up for a free account: https://ngrok.com/signup
- Keep your authtoken handy: https://dashboard.ngrok.com/get-started/your-authtoken
macOS
Linux
Windows
Kubernetes
Docker
SDKs
Expose different kinds of servers
Read the Docs: https://ngrok.com/docs/agent/#example-usage
API service
Web app
SSH server
Postgres server
Any service or server on a different machine
Troubleshoot
Read the Docs: https://ngrok.com/docs/agent/#troubleshooting-connectivity
Add authentication with Traffic Policy
Read the Docs: https://ngrok.com/docs/traffic-policy/
Create a Traffic Policy file policy.yaml
Add the OAuth Action with Google
List of Providers: https://ngrok.com/docs/traffic-policy/actions/oauth/#supported-providers
Run your endpoint with the Traffic Policy file
Restrict OAuth to specific emails
Restrict OAuth to specific domains
Verify your webhooks
Read the Docs: https://ngrok.com/docs/traffic-policy/actions/verify-webhook/
Add the verify-webhook action for Slack
Read more: https://ngrok.com/docs/integrations/webhooks/slack-webhooks
CLI Alternative
Replace provider for any supported provider
List of supported providers: https://ngrok.com/docs/traffic-policy/actions/verify-webhook/
Do even more with internal endpoints
Read the docs: https://ngrok.com/docs/endpoints/internal-endpoints
Create an internal agent endpoint
Create a Cloud Endpoint
Read the Docs: https://ngrok.com/docs/traffic-policy/actions/forward-internal/
- Create a new Cloud Endpoint in your ngrok Dashboard
- Enter a static URL you’ve reserved
- Click Create Cloud Endpoint
- Replace the default Traffic Policy with the following:
Manage traffic in other ways
Add path-based routing
Read the Docs: https://ngrok.com/docs/endpoints/cloud-endpoints/routing-and-policy-decentralization
Route traffic by anything
Read the Docs: https://ngrok.com/docs/traffic-policy/actions/forward-internal/#examples
Multiplex to internal services from a single domain
Read the Docs: https://ngrok.com/docs/gateway/examples/multiplex
Add rate limiting
Read the Docs: https://ngrok.com/docs/traffic-policy/actions/rate-limit/
Block search and AI bots
Read the Docs: https://ngrok.com/docs/traffic-policy/examples/block-unwanted-requests/#how-do-i-deny-traffic-from-bots-and-crawlers-with-a-robotstxt
Add headers
Read the Docs: https://ngrok.com/docs/traffic-policy/actions/add-headers/
Via CLI
Via Traffic Policy
Restrict access by IPs
Read the Docs: https://ngrok.com/docs/traffic-policy/actions/restrict-ips/
Block all the potentially bad things
Read the Docs: https://ngrok.com/docs/traffic-policy/actions/owasp-crs-response/
CLI Flags
url
traffic-policy-file
traffic-policy-url
pooling-enabled
What else can I do with ngrok?
- Use the ngrok Kubernetes Operator: https://ngrok.com/docs/k8s/
- Get started with traffic observability: https://ngrok.com/docs/obs/
- Read ngrok’s security best practices: https://ngrok.com/docs/gateway/security-dev-productivity/
- Check out the gateway Examples Gallery: https://ngrok.com/docs/gateway/examples
Ending notes
The first iteration of the ngrok cheat sheet was created by Keith Casey, who served on the Product/GTM Team at ngrok.