Skip to main content
← All guides

ERR_NGROK_4018: Fix “This ngrok session is not authenticated”

ERR_NGROK_4018 means the ngrok agent started without an authtoken. ngrok requires an account: sign up, copy your authtoken from the dashboard, and save it with ngrok config add-authtoken <token>, or set NGROK_AUTHTOKEN. To skip the account entirely, publish the app with qURL™: no sign-up, token or API key, and the app stays private with no public URL.

Why qURL here

qURL never asks for an account, an authtoken or an API key: install the CLI, publish, and send a link, with up to 3 active resources, with links that last up to 24 hours. The app gets no public URL and no open port, so there is nothing for scanners to find. Invite people by email, or send one person a link that opens once, and end access with one command.

See how qURL compares to ngrok →

Where the missing token comes from

Where the missing token comes from
SituationWhat fixes ERR_NGROK_4018Step
A new machine or a fresh installSign up, copy the authtoken from the dashboard, and save it with ngrok config add-authtokenStep 1
A container, CI job or coding agent’s shellSet the NGROK_AUTHTOKEN environment variable, which overrides the config fileStep 2
You would rather not create an accountPublish the app with qURL instead: nothing to sign up for and no token to storeStep 3

Steps

  1. 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 3000

    Check: ngrok http starts and prints a forwarding URL instead of ERR_NGROK_4018.

  2. 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 3000
  3. Or share the app with no account at all

    On macOS, install it with Homebrew. On Linux and Windows, download the package for your platform from the latest release; the CLI page lists each one. For commands with --name, qurl --version must print 4.0.0 or later. Update an older CLI before copying those commands. Nothing asks you to sign up. There is no authtoken to fetch, store or rotate: the first qurl publish creates this device’s identity on its own.

    brew install layervai/tap/qurl
    brew upgrade qurl
    qurl --version

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

Troubleshooting
If you seeDo this
The authtoken is saved but ERR_NGROK_4018 persistsThe 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 authtokenngrok’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
More troubleshooting
If you seeDo this
qurl publish says the local app is not accepting TCP connectionsStart 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 runAdd --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.

Publish your app now

Install the CLI, then run one command. No sign-up, no API key.

Install the CLI →

Book a pilot

Tell us what to hide. We’ll scope a pilot.

Enterprise starts with a paid pilot on one application, typically 60 to 90 days, credited in full toward year one if you convert within 60 days. After that, an annual package sized to what you protect, not per seat.