Short answer
No. On ngrok's free tier there is no supported CLI flag or dashboard action that reserves a fixed *.ngrok.io subdomain across restarts. Each new agent session receives a randomly assigned hostname. Ingress rules (edge routing or traffic policy) only decide where traffic that already arrived at an assigned hostname is forwarded; they do not create, pin, or reserve that hostname.
Confirmed behavior vs. likely behavior
- Confirmed: free-tier tunnels get a random hostname per session, so restarting the agent yields a different one.
- Confirmed:
--subdomain (older clients) and --domain (current clients) request a specific name, but the reservation or mapping is plan-gated and rejected on free accounts. Supplying an authtoken does not grant reserved-hostname rights.
- Likely, version-sensitive: ingress and traffic-policy rules match on host and path and forward to one or more upstreams. They operate on the hostname ngrok already assigned, so they cannot stabilize it.
Flag names changed between client generations, so treat any specific flag as version-dependent and confirm against your installed client rather than a blog post.
Verify it on your own account
ngrok http 3000
# record the assigned hostname, then stop with Ctrl+C
ngrok http 3000
# compare the two hostnames
ngrok http --domain=my-fixed-name.ngrok.app 3000
# current-style flag; expect a plan-restriction response on free
ngrok http --help
# read the plan notes printed next to the domain-related flags
Then open the dashboard and look for a reserved-domains or domains section. On a free account it should offer no reservation. If your output differs, either the plan or the client generation has changed, and this guidance should be re-checked before you rely on it.
Practical routes to a stable URL
- External indirection: keep a fixed address (small VPS, serverless proxy, or load balancer) and point it at the current ngrok hostname. Update the target after each restart; this can be scripted from the agent's local API.
- Use a DNS name you control: a named tunnel with your own domain is the durable answer, but it requires domain ownership and falls outside the stated constraint.
- Paid reserved domain: the only supported way to pin an ngrok hostname.
A CNAME from your own domain directly to a random ngrok hostname is a common suggestion, but the request would arrive with your domain in the Host header rather than the assigned one. Whether the edge accepts that depends on plan and configuration, so treat it as unverified for free tier and test before depending on it.
The one detail that changes the recommendation
Can you control a DNS name at all? If yes, a proxy or named tunnel in front of ngrok is the clean fix. If you must stay entirely on *.ngrok.io with no owned domain and no paid plan, then no configuration option exists — only external indirection that you update after each restart.