How to Use Local Network While Using BrowserStack
Hi, I’m Nadeem — an ISTQB-certified QA engineer with over 7 years of experience in mobile, web, and cross-browser testing. If you’ve ever needed to test websites hosted on your local machine or internal staging environments using BrowserStack, this guide is for you.
If you're wondering how to use local network while using BrowserStack, this guide will walk you through it step by step — from setup to real device validation.
In this post, we’ll walk through exactly how to use local network while using BrowserStack — safely, securely, and with real device coverage.
Why Use Local Testing on BrowserStack?
BrowserStack provides a cloud platform for testing your website or app on thousands of real browsers and devices. But what if your app isn’t deployed publicly yet?
That’s where BrowserStack Local comes in. It lets you securely test local servers, staging environments, and internal networks — without exposing them to the public internet.
When Should You Use Local Testing?
- You're testing a website on
localhostor127.0.0.1 - You're accessing staging environments restricted by VPN/firewall
- Your APIs are not yet deployed on public URLs
- You want to simulate real devices accessing your dev machine
In all of these cases, you need a secure tunnel from BrowserStack's cloud to your machine — and that’s exactly what we’ll set up.
Step-by-Step: How to Use Local Network While Using BrowserStack
1. Download the BrowserStack Local Binary
Go to the official link: browserstack.com/local-testing
Download the binary for your OS (macOS, Windows, or Linux) and unzip it.
2. Authenticate Using Your Access Key
In your terminal, run:
./BrowserStackLocal --key YOUR_ACCESS_KEY
Replace YOUR_ACCESS_KEY with the one from your BrowserStack account dashboard.
3. Confirm the Connection
Once the binary connects, you'll see a message: "You can now access your local server(s) in our remote browser."
Try accessing localhost:3000 or whatever local port your app runs on — from a real device in BrowserStack!
4. Automate with BrowserStack Local in Selenium
If you're using Selenium or Playwright, you can enable local testing with capabilities:
{
"browserstack.local": "true",
"browserstack.localIdentifier": "QA_ENV_123"
}
Make sure to start the local tunnel before launching your tests.
5. Use Local Identifier (Optional but Recommended)
If you’re running multiple parallel sessions or in CI/CD, provide a unique identifier:
./BrowserStackLocal --key YOUR_ACCESS_KEY --local-identifier QA_ENV_123
This helps isolate each tunnel session and avoids conflicts.
Tips for a Stable Local Testing Session
- Keep the tunnel open until your tests complete
- Whitelist domains/ports if using firewalls
- Use verbose mode for debugging:
./BrowserStackLocal --key YOUR_KEY --verbose true - Automate teardown in CI to stop the binary after test completion
Troubleshooting Common Issues
- Can't access localhost? Confirm your app is running and listening on the right port.
- Proxy blocking traffic? Set the correct proxy flags or run without one.
- Stuck on “connecting…”? Check your access key and firewall settings.
Summary
Using your local network while testing on BrowserStack unlocks powerful testing capabilities — including staging environments, under-development apps, and firewall-restricted APIs. With the BrowserStack Local binary, you can tunnel securely and test on real browsers and devices with zero code changes to your app.
It’s fast, secure, and essential for any serious QA workflow.
By following these steps, you now know how to use local network while using BrowserStack to test internal environments, localhost, or under-development builds securely and at scale.
Read more QA blogs at inadeem.me
Connect with me on LinkedIn