Skip to content

ngrok Commands Reference ​

Fresh

Tunnel Commands ​

CommandDescription
ngrok http 8080HTTP tunnel to port 8080
ngrok http 8080 --url https://example.ngrok.appHTTP with custom domain
ngrok http 192.168.1.2:80Forward to non-local service
ngrok http https://localhost:8443Forward to local HTTPS
ngrok http '[::1]:80' --url https://ipv6.example.comForward to IPv6
ngrok tcp 22TCP tunnel (SSH, databases)
ngrok tls 80 --url tls://name.ngrok.appTLS tunnel
ngrok start foo barStart named endpoints from config
ngrok start --allStart all endpoints in config

Configuration Commands ​

CommandDescription
ngrok config add-authtoken TOKENAdd your authtoken
ngrok config add-api-key KEYAdd API key
ngrok config checkValidate config and show location
ngrok config editOpen config file in editor

Service Commands (Windows) ​

CommandDescription
ngrok service install --config PATHInstall as Windows service
ngrok service startStart the service
ngrok service stopStop the service
ngrok service restartRestart the service
ngrok service uninstallRemove the service

API Commands ​

CommandDescription
ngrok api endpoints listList active endpoints
ngrok api reserved-domains listList reserved domains
ngrok api tunnel-sessions listList tunnel sessions

Utility Commands ​

CommandDescription
ngrok helpShow help text
ngrok versionShow ngrok version
ngrok updateUpdate ngrok to latest version
ngrok diagnoseTroubleshoot connection issues
ngrok completionGenerate shell tab completion

Configuration File Location (Windows) ​

%HOMEPATH%\AppData\Local\ngrok\ngrok.yml

Environment Variables ​

VariableDescription
NGROK_AUTHTOKENAuthtoken (overrides config)
NGROK_API_KEYAPI key (overrides config)

Config File Example ​

yaml
version: "3"
authtoken: YOUR_TOKEN

endpoints:
  - name: webapp
    url: https://myapp.ngrok.app
    traffic_policy:
      on_http_request:
        - actions:
          - type: oauth
            config:
              provider: google
    upstream:
      url: 8080
      protocol: http1

  - name: api
    url: https://myapi.ngrok.app
    upstream:
      url: 3000
      protocol: http1

Traffic Policy File Example ​

yaml
on_http_request:
  - actions:
      - type: basic-auth
        config:
          credentials:
            - admin:password123

Connectivity Details ​

PropertyValue
Connect addressconnect.ngrok-agent.com:443
Port443 (TLS)
CRL checkcrl.ngrok-agent.com (port 80)
Update checkupdate.equinox.io
HeartbeatAutomatic, configurable

Keyboard Shortcuts (Console UI) ​

ShortcutAction
Ctrl+CStop ngrok
Ctrl+UUpdate ngrok (when prompted)

Built with VitePress + Claude RAG Chat