- Expose local services securely to AI coding assistants and external tools
- Test real OAuth flows, webhooks, and API integrations during development
- Apply traffic transformations and header manipulation in your dev environment
- Debug production-like traffic patterns before deploying
- Share work-in-progress with teammates and stakeholders securely
1. Create internal endpoints for your local services
Start Agent Endpoints for your local development services using internal URLs. Replace$PORT
with your actual service ports.
2. Reserve a domain
Navigate to the Domains section of the ngrok dashboard and click New + to reserve a free static domain likehttps://your-service.ngrok.app
or a custom domain you already own.
We’ll refer to this domain as $NGROK_DOMAIN
from here on out.
Consider using a subdomain like
dev.yourcompany.com
or staging.yourproject.com
to clearly distinguish from production.3. Create a Cloud Endpoint
Navigate to the Endpoints section of the ngrok dashboard, then click New + and Cloud Endpoint. In the URL field, enter the domain you just reserved to finish creating your Cloud Endpoint.4. Apply Traffic Policy for development gateway
While still viewing your new cloud endpoint in the dashboard, copy and paste the policy below into the Traffic Policy editor. Make sure you change each of the following values:$GITHUB_OAUTH_CLIENT_ID
: Replace with your GitHub OAuth app client ID for development$GIBHUB_OAUTH_CLIENT_SECRET
: Replace with your GitHub OAuth app secret for development$YOUR_DEV_API_KEY
: Replace with an API key for development access- Internal service URLs: Replace with your actual internal endpoint URLs
5. Try out your development gateway
Visit the domain you reserved either in the browser or in the terminal using a tool likecurl
.
You should see the app or service at the port connected to your internal Agent Endpoint.
Test different aspects of your development setup:
- They can access your API schema:
https://$NGROK_DOMAIN/api/schema
- Test frontend builds against your real backend:
https://$NGROK_DOMAIN/api/*
- Receive webhooks for real-time collaboration:
https://$NGROK_DOMAIN/webhooks/ai-assist
What’s next?
- Read about other gateway shapes you can build with ngrok
- Learn about securing developer environments for team-wide development workflows
- Explore webhook integrations for testing with real services during development
- Set up Traffic Inspector to debug request flows and authentication issues
- Configure custom domains for more professional development URLs