Where Does ngrok Store Config and Tunnels?
ngrok keeps its config file and auth token in a per-OS config folder (~/.config/ngrok/ngrok.yml), with tunnels defined per session or file.
Last updated
ngrok needs almost no local state for casual use, which is why the config file surprises people when it appears. Ad-hoc tunnels take all options as flags. The config file enters the picture for authtokens, reserved domains, and named multi-tunnel setups.
The file is plain YAML in the standard per-OS config spot. Tunnels defined there start by name instead of by flags, which keeps long command lines out of shell history. Agent ingress and endpoint pooling all key off the same file.
Where ngrok stores this, by platform
~/.config/ngrok/ngrok.yml
Authtoken plus named tunnel definitions in YAML. The add-authtoken command writes the token here. Ad-hoc tunnels work without any file at all.
~/.config/ngrok/ngrok.yml
Same config role on macOS. Homebrew installs agree on this spot; only the binary location differs from direct downloads.
%USERPROFILE%\.config\ngrok\ngrok.yml
Same relative layout under the user profile on Windows. Reserved domains and multi-tunnel setups read from here; quick tests can skip the file entirely.
Frequently asked questions
Where does the auth token live?
Run ngrok config add-authtoken with your dashboard token. It writes the token into the config file so later sessions authenticate without flags. Rotate the token on the dashboard if it ever leaks.
Do I need a config file for basic tunnels?
Define tunnels in the config file under a tunnels section, then start them by name. Ad-hoc ngrok http 3000 needs no file at all; the config only matters for reserved domains and multi-tunnel setups.
Notice an outdated path? Let us know.