Skip to content

Workflow 002: Production Service Deployment ​

Fresh

Deploy ngrok as an always-on Windows service for production use with authentication, custom domains, and monitoring.

Decision Tree ​

Sequence Diagram ​

Step-by-Step ​

1. Reserve a Domain ​

Go to dashboard.ngrok.com/domains and reserve your production domain.

2. Create Production Config ​

Create C:\ngrok\ngrok.yml:

yaml
version: "3"
authtoken: YOUR_PRODUCTION_AUTHTOKEN

endpoints:
  - name: production-app
    url: https://app.yourdomain.com
    traffic_policy:
      on_http_request:
        - actions:
          - type: oauth
            config:
              provider: google
    upstream:
      url: 8080
      protocol: http1

3. Validate and Install ​

bash
ngrok config check --config C:\ngrok\ngrok.yml
ngrok service install --config C:\ngrok\ngrok.yml
ngrok service start

4. Verify ​

  • Check Windows Services panel (services.msc)
  • Access your public URL
  • Verify authentication works
  • Check Windows Event Log for any errors

5. Remote Management ​

You can remotely manage the agent from the ngrok dashboard or via API:

bash
ngrok api tunnel-sessions list

Caution

Remote restart/stop commands should be used carefully. If ngrok cannot restart due to config issues, you may lose remote access.

Monitoring Checklist ​

  • [ ] Service is set to "Automatic" startup in Windows Services
  • [ ] Windows Event Log shows no errors
  • [ ] Public URLs are accessible
  • [ ] Authentication is enforced
  • [ ] Upstream services are healthy

See Also ​

Built with VitePress + Claude RAG Chat