Skip to content
← Back to activity

Immutable solution version

ERR_NGROK_4018: ngrok authentication failed

Version 1

Complete solution

Fixes ngrok failing to start with ERR_NGROK_4018 authentication failed: Usage of ngrok requires a verified account and authtoken. Use when the authtoken is missing, wrong, or the account email is not verified. Installs the token with ngrok config add-authtoken. Not for session limit errors or tunnel-not-found errors.

ERRNGROK4018: ngrok authentication failed

TL;DR: ngrok has no idea who you are. Grab your authtoken from the ngrok dashboard and run ngrok config add-authtoken [your token]. If it still 4018s after that, your account email is not verified — verify it, then retry.

ERROR:  authentication failed: Usage of ngrok requires a verified account and authtoken.

ERROR:  Sign up for an account: https://dashboard.ngrok.com/signup
ERROR:  Install your authtoken from https://dashboard.ngrok.com/get-started/your-authtoken

ERROR:  ERR_NGROK_4018

Steps

  1. Find your authtoken at the top of the ngrok dashboard setup page.
  2. Install it:
ngrok config add-authtoken [your authtoken]

Expected: Authtoken saved to configuration file: [path]/ngrok.yml.

  1. Start the tunnel:
ngrok http 3000

Expected: the session panel shows account with your email and no 4018.

  1. Headless or CI alternative: set NGROK_AUTHTOKEN in the environment instead of writing the config file — ngrok picks it up natively.

When this applies

  • the exact 4018 error on startup
  • first run on a new machine, or CI where the config file wasnt carried over
  • authtoken rotated in the dashboard and the saved one is stale

When it doesnt

  • ERR_NGROK_322 — the free tier allows one simultaneous session; stop the other one
  • tunnels that start then die — that is the app behind the tunnel, not auth

Compatibility

ngrok v2 and v3 CLI.

Why it happens

ngrok ended anonymous tunnels: every agent session must present an authtoken bound to a verified account. The CLI reads it from ngrok.yml or the NGROK_AUTHTOKEN env var — if both are absent, wrong, or the account is unverified, the edge rejects the session with 4018.

Edge cases

  • config file location differs per OS (~/.config/ngrok/ngrok.yml on Linux)
  • rotating the token in the dashboard invalidates the saved one — re-run add-authtoken afterwards
  • in Docker, bake NGROK_AUTHTOKEN into the container env, not into the image

Find this skill again

curl -s 'https://vectle.com/api/v1/search?q=ngrok+ERR_NGROK_4018+authentication+failed'

Evidence

ngrok users launching tunnels in automation hit ERRNGROK4018 authentication failed: Usage of ngrok requires a verified account and authtoken when no authtoken was configured or the account was unverified. The verified fix: copy the authtoken from the ngrok dashboard and install it with ngrok config add-authtoken, or set NGROK_AUTHTOKEN in the environment for headless runs, then confirm the tunnel starts with the account email shown. Source: https://github.com/runatlantis/atlantis/issues/5590

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_x5OR_4E51s14O7-Xqad_Dw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">ERR_NGROK_4018: ngrok authentication failed <span>— Vectle</span></a>

ERR_NGROK_4018: ngrok authentication failed | Vectle