Diagnosing BrowserStack Local Testing Connection Failures
Step‑by‑step diagnostic guide for BrowserStack Local Testing connection failures, covering access key, firewall, binary version, proxy, and resource checks with fixes and escalation paths.
08 Apr 2026, 12:33 UTC

Recognizable condition
When you start a BrowserStack Automate session that relies on Local Testing, the dashboard shows an "Unable to connect to local server" error and the tunnel indicator turns red or disappears shortly after launch.
Short cause/diagnostic table
| Symptom | Likely cause |
|---|---|
| Tunnel fails to start or exits immediately | Missing or incorrect access key |
| Tunnel starts but disconnects after a few seconds | Firewall blocking outbound traffic to bs-local.com on ports 45691, 80, or 443 |
| Verbose logs show proxy authentication errors | Corporate proxy interfering with the tunnel |
| High CPU/RAM usage on the host machine | Insufficient resources for the Local binary |
| Using an older binary version | Outdated or corrupted BrowserStack Local executable |
Ordered checks
- Verify the access key
- Where to run: any terminal on the machine hosting the Local binary.
- Permission: read access to the environment variable or config file.
- Command:
echo $BROWSERSTACK_ACCESS_KEY(Linux/macOS) orecho %BROWSERSTACK_ACCESS_KEY%(Windows). - Expected check: the output should match the key shown in your BrowserStack Automate dashboard.
- Risk: exposing the key in shell history; consider using
read -sto avoid echoing.
- Check firewall rules
- Where to run: terminal with administrative/root privileges.
- Permission: ability to add/modify outbound rules.
- Command (Linux example):
sudo iptables -L -v -n | grep bs-local.com - Expected check: no DROP/REJECT rules for ports 45691, 80, or 443 targeting
bs-local.com. - Risk: incorrectly modifying firewall may block other services; document existing rules before changes.
- Confirm binary version and integrity
- Where to run: directory containing the Local binary.
- Permission: execute permission on the binary.
- Command:
./BrowserStackLocal --version - Expected check: version number matches the latest release listed on the BrowserStack documentation page.
- Risk: running an unverified binary could introduce security issues; download only from the official BrowserStack site.
- Assess proxy requirements
- Where to run: same terminal as the Local binary.
- Permission: read access to proxy credentials (if any).
- Command (if proxy needed):
./BrowserStackLocal --proxy-host --proxy-port --proxy-user --proxy-pass --key - Expected check: after launching with proxy flags, the verbose log should not contain "proxy authentication failed".
- Risk: exposing proxy credentials in process lists; consider using a credential file with restricted permissions.
- Monitor system resources
- Where to run: system monitor (top, Task Manager, etc.) while the tunnel is running.
- Permission: none required for observation.
- Expected check: CPU usage stays well below 80% and free RAM > 200 MB.
- Risk: none; if usage is high, close non‑essential applications.
- Run the tunnel with verbose logging
- Where to run: terminal where you start Local Testing.
- Permission: execute the binary.
- Command:
./BrowserStackLocal --key --verbose - Expected check: log lines containing "Connected to BrowserStack" and "LocalTesting connection established" appear and persist.
- Risk: verbose output may include sensitive URLs; avoid sharing logs publicly.
Fixes tied to findings
- Missing/incorrect access key: set or correct the
BROWSERSTACK_ACCESS_KEYenvironment variable or pass it via--keyflag. - Firewall blocking: add outbound allow rules for
bs-local.comon TCP ports 45691, 80, and 443, or temporarily disable the firewall for testing (re‑enable immediately after). - Outdated binary: download the latest BrowserStack Local binary from the official download page, replace the existing executable, and ensure it is marked executable (
chmod +x BrowserStackLocalon Unix). - Proxy interference: invoke the binary with the appropriate
--proxy-host,--proxy-port,--proxy-user, and--proxy-passflags that match your corporate proxy settings. - Insufficient resources: close memory‑ or CPU‑intensive applications, or run the tunnel on a machine with higher specifications.
Escalation criteria
If after performing all checks and applying the corresponding fixes the tunnel still fails to stay connected, consider the following steps before contacting BrowserStack Support:
- Capture the full verbose log (
--verbose) and save it to a file. - Note the exact timestamp, operating system version, and binary version.
- Verify that the internal web application is reachable locally (e.g.,
curl http://localhost:3000) to rule out application‑side issues. - If the problem persists, open a support ticket and attach the verbose log, system‑resource snapshot, and firewall/proxy configuration details.
Limitations and practical verification
BrowserStack Local Testing only tunnels standard HTTP, HTTPS, and WebSocket traffic on the allowed ports (45691 for WebSocket, 80/443 for HTTP/HTTPS). It does not support raw TCP or other protocols on non‑standard ports. To verify that your application relies only on supported protocols, inspect network requests in the browser’s developer tools; any attempt to connect to a port outside the allowed set will fail.
A practical way to confirm a successful tunnel after applying a fix is:
- Start the Local binary with
--verbose. - In a separate terminal, run a simple request to your local server, e.g.,
curl -I http://localhost:3000. - Return to the Local binary output and look for a log line indicating a request was proxied, such as "[INFO] Received request for http://localhost:3000/".
- Keep the tunnel running for the duration of your test suite and ensure the "Connected to BrowserStack" message remains present without subsequent disconnect warnings.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.