# ERR_NGROK_8012: Fix ngrok’s Failed Upstream Connection

> ERR_NGROK_8012 means ngrok reached your machine but not your app. Start the app, match the port and address, then retry. qURL checks the app before it shares.

Source: https://layerv.ai/guides/ngrok-err-8012-upstream-connection-failed/

---

[← All guides](https://layerv.ai/guides/) 

# ERR\_NGROK\_8012: Fix ngrok’s Failed Upstream Connection

ERR\_NGROK\_8012 means traffic reached the ngrok agent, but nothing answered at the local address it forwards to. Start the app, confirm curl gets a response on that port, and restart ngrok with the matching port, such as ngrok http 3000\. qURL™ won’t publish an app that isn’t running, so you find the problem before you send a link, not after.

## Why qURL here

qURL checks that your app is answering before it publishes, then gives it no public URL and no open port, so scanners have nothing to find. Install the CLI with no account, invite people by email or send one person a link that opens once, and end access with one command. A background service keeps the share serving after you close the terminal.

[See how qURL compares to ngrok →](https://layerv.ai/compare/qurl-vs-ngrok/)

Copies a prompt for any agent that runs commands. 

## What you need

- The qURL CLI 4.0.0 or later
- The app you want to share, and its port

Content updated November 23, 2026.

## Causes of ERR\_NGROK\_8012

__Causes of ERR\_NGROK\_8012__
| Cause                                                                              | How to spot it                                                      | Fix                                                                                    |
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| The app is not running                                                             | curl to the port fails with “Connection refused”                    | Start the app, then reload the page                                                    |
| The ngrok command names the wrong port                                             | The dev server prints a different port from the one in ngrok http   | Restart ngrok with the port the app prints                                             |
| The app listens on another address, such as IPv6 only or a container’s own network | lsof shows the app on \[::1\] or a container address, not 127.0.0.1 | Point the tunnel at the exact address the app listens on, or bind the app to 127.0.0.1 |

## Steps

1. ### Confirm the app answers on its own  
ngrok’s first check for ERR\_NGROK\_8012 is to reach the service directly, without ngrok. If curl fails here, the problem is the app, not the tunnel: start it, or wait for the dev server to finish compiling.  
```  
curl -I http://localhost:3000
```

**Check:** curl prints an HTTP status line, such as HTTP/1.1 200 OK.
2. ### Find the port and address the app really uses  
Dev servers move to the next port when theirs is taken, and some listen only on IPv6\. On macOS or Linux, lsof lists every listening socket with its address. Match the tunnel to what it prints.  
```  
lsof -iTCP -sTCP:LISTEN -nP
```
3. ### Restart ngrok on the right port  
ngrok’s fix for a port mismatch is to restart the agent with the port your service uses. Update to the latest ngrok release if the error persists.  
```  
ngrok http 3000
```
4. ### Or share the app with qURL, which checks it first  
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. `qurl publish` refuses an app that is not running, so a broken address shows up in your terminal instead of on a recipient’s screen.  
```  
brew install layervai/tap/qurl
brew upgrade qurl
qurl --version
```
5. ### Publish the app and make a link  
`qurl publish` connects to the app on 127.0.0.1, waits until the route is serving, prints the CRID and exits. A failure before that, such as an app that isn’t running, creates nothing. `qurl share` then makes a link that opens once and expires within 24 hours, and the app never gets a public URL.  
```  
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.

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 see                                           | Do this                                                                                                                                                                                                                                         |
| ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| curl works but ERR\_NGROK\_8012 still appears        | The tunnel and curl are reaching different addresses. If the app listens on \[::1\] only, localhost and 127.0.0.1 can resolve differently; point the tunnel at the address lsof shows, or start the dev server with --host 127.0.0.1.           |
| The error appears only while the dev server restarts | Requests that arrive while the app is down have nowhere to go. Reload once the server is back. A qURL share survives the restart: the CRID belongs to the address, not the process, so recipients reload once the app is back on the same port. |

__More troubleshooting__
| 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 →](https://layerv.ai/guides/share-from-a-container-or-ci/)                                                                                                                                                                                                  |
| 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

What does “upstream” mean in ERR\_NGROK\_8012? 

The upstream is your own app: the local service the ngrok agent forwards traffic to. ngrok’s page explains that the tunnel was created and traffic reached the agent, but the agent could not open a connection to that service.

Can I show a nicer page when my app is down? 

ngrok suggests a Cloud Endpoint with a Traffic Policy that serves a maintenance page instead of the error. While your app is down, recipients cannot load it through qURL. Restart the app on the same port and have them reload in their existing session. The share keeps its CRID.

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.

## Related Resources

[qURL vs ngrok →](https://layerv.ai/compare/qurl-vs-ngrok/) [Guide: Switch from ngrok →](https://layerv.ai/guides/switch-from-ngrok/) [Guide: Get past the ngrok browser warning →](https://layerv.ai/guides/skip-ngrok-browser-warning/) [Guide: Fix ERR\_NGROK\_3200, endpoint offline →](https://layerv.ai/guides/ngrok-err-3200-endpoint-offline/) [Guide: Allow a tunnel hostname in your dev server →](https://layerv.ai/guides/allow-tunnel-hostname-in-dev-server/) [ngrok alternatives →](https://layerv.ai/compare/ngrok-alternatives/) [ngrok docs: ERR\_NGROK\_8012 ↗](https://ngrok.com/docs/errors/err%5Fngrok%5F8012)

## Publish your app now

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

[Install the CLI →](https://layerv.ai/cli/)



---

*This markdown version is auto-generated from [https://layerv.ai/guides/ngrok-err-8012-upstream-connection-failed/](https://layerv.ai/guides/ngrok-err-8012-upstream-connection-failed/) for AI agents. Curated agent resources: [llms.txt](https://layerv.ai/llms.txt). For the full interactive experience, visit the HTML version.*

Site search: POST https://4f981608-057a-48bb-b205-a289823b32e4.search.ai.cloudflare.com/search with JSON `{"messages":[{"role":"user","content":"YOUR QUERY"}]}`. Results include public content and source URLs.

