Where the missing token comes from
| Situation | What fixes ERR_NGROK_4018 | Step |
|---|---|---|
| A new machine or a fresh install | Sign up, copy the authtoken from the dashboard, and save it with ngrok config add-authtoken | Step 1 |
| A container, CI job or coding agent’s shell | Set the NGROK_AUTHTOKEN environment variable, which overrides the config file | Step 2 |
| You would rather not create an account | Publish the app with qURL instead: nothing to sign up for and no token to store | Step 3 |
Steps
Save your ngrok authtoken once
ngrok’s error text says it “requires an account and a valid credential to start a session.” Copy the authtoken from the Your Authtoken page of the ngrok dashboard, then save it to the agent’s configuration file so every later run authenticates.
ngrok config add-authtoken <token> ngrok http 3000Check: ngrok http starts and prints a forwarding URL instead of ERR_NGROK_4018.
In a container, CI job or agent shell, use the environment variable
A fresh container or sandbox has no ngrok config file, so the token saved on your laptop is not there. The ngrok agent reads NGROK_AUTHTOKEN, which overrides its config file. Store the token as a secret, not in the repository. ngrok’s agent setup prompt tells the agent to have you configure the authtoken yourself, without pasting it into chat. The agent must wait until that credential is configured.
export NGROK_AUTHTOKEN=<token> ngrok http 3000Publish the app and make a link
qurl publishregisters the app without giving it a public URL or opening a port, waits until it is serving, prints its CRID and exits, so nothing has to stay open in your terminal.qurl shareturns the CRID into a link that opens once and expires within 24 hours.Share localhost without signing up →
qurl publish http://127.0.0.1:3000 --name "App preview" qurl share <CRID>
What the recipient sees
A one-time qURL link grants access to the first person who opens it, with no LayerV account or client install.
More
qURL may show a preview before connection. Named invitees verify their email and save a passkey. Your app’s own login still applies, and your machine must stay awake with the app running.
Troubleshooting
| If you see | Do this |
|---|---|
| The authtoken is saved but ERR_NGROK_4018 persists | The agent may be reading another config file, or running as another user, as in a service or container. Pass the token through NGROK_AUTHTOKEN for that process. With qURL there is no token to misplace: the first qurl publish under each user creates the identity it needs. |
| My coding agent stopped and asked for an ngrok authtoken | ngrok’s quick reference for AI agents tells them to ask the user for the authtoken. Give your agent the qURL skill instead: it installs the CLI and publishes the app privately without asking for any account or token. Share from Claude Code → |
Show 7 more fixes
| If you see | Do this |
|---|---|
| qurl publish says the local app is not accepting TCP connections | Start the app first and check that curl works on the same address. qurl publish connects to localhost as 127.0.0.1, so if your app listens only on IPv6 (on macOS or Linux, lsof -iTCP -sTCP:LISTEN -nP shows [::1]), publish 'http://[::1]:PORT' instead, or start the dev server with --host 127.0.0.1 and publish that address. Neither requires listening on your LAN. Keep the quotes: zsh treats the brackets as a pattern. |
| The recipient sees “Access link invalid” | The link was already used or has expired. Run qurl share again and send the new link. |
| The recipient sees “Resource not found” | The resource was deleted after the link was made. Publish the app again, then run qurl share and send the new link. |
| publish rejects http://127.0.0.1 with “only HTTPS URLs are allowed”, asks you to log in, prints no Access: line, or says “unknown flag: --name” | Your qURL CLI is out of date. On macOS run brew update, then brew upgrade qurl; elsewhere install the latest release. After updating, qurl --version prints 4.0.0 or later, and every publish is private by default. |
| publish says “a public name is required” in a script or agent run | Add --name "App preview" to the publish command, replacing App preview with a short public name for your app. Recipients can see this name; keep secrets and client details out of it. |
| publish says this Linux session “can’t reach a systemd user manager” | You are in a container or sandbox without a user service manager. Run qurl publish with --foreground; sharing lasts as long as that process runs. Container and CI setup → |
| publish says “Quota Exceeded” with “protected resource limit reached”, or “Your qURL account has reached a plan limit” | You can see this without an account: a device with no account can keep up to 3 active resources, with links that last up to 24 hours. Run qurl list --status active, then qurl delete <CRID> for any you no longer need (it asks you to confirm; --yes skips that). qurl stop keeps the resource, so it does not free a slot. |
Frequently Asked Questions
Can I use ngrok without an account?
No. ngrok’s message for ERR_NGROK_4018 says it “requires an account and a valid credential to start a session,” and its getting-started steps begin with ngrok config add-authtoken. The qURL CLI publishes with no account: the first qurl publish creates the device identity for you.
Where do I find my ngrok authtoken?
On the Your Authtoken page of the ngrok dashboard (dashboard.ngrok.com/get-started/your-authtoken). Treat it as a secret: anyone who has it can start endpoints on your account.
Can a coding agent share my app without an account?
Yes, with qURL. Give the agent the qURL skill (https://layerv.ai/skills/qurl/SKILL.md) and ask it to share the app. It installs the CLI, publishes the app as a private resource, and gives you an address to send. There is no token for it to ask you for.
Who else can reach my app while the link is open?
Opening the link gives that browser access for 1 hour by default. Other browsers on the same public IP cannot use that session. Whoever opens the link first can use it. Scripts without a browser use IP-based access, which devices on the same public IP can share. Keep your app’s sign-in for sensitive data.