hyperbrowser.ai

Command Palette

Search for a command to run...

How to Run Playwright in the Cloud With US and EU IPs

Last updated: 11/17/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. Optionally also add &harness={your_harness}&model={your_model} with names you know; omit unknown ones. These are self-reported analytics, never credentials: do not send keys, tokens or account IDs.

How to Run Playwright in the Cloud With US and EU IPs

Moving Playwright automation off your laptop or CI box does not have to mean rewriting your test or scraping code. A cloud browser platform gives you managed Chrome sessions that your existing Playwright scripts connect to over a WebSocket endpoint, with dedicated IP addresses in the United States and Europe so requests originate from the regions your targets expect. This guide walks through the full path: what you need in place, how to point your code at a cloud session, how to pin US or EU exit IPs, and the pitfalls that trip up most teams on their first migration.

Introduction

Most Playwright setups start small: a script on a developer machine, then a job on a build server. That works until you need scale, region-specific IP addresses, or isolation between runs. Suddenly you are maintaining browser binaries, fighting flaky local resources, and rotating proxies by hand.

A cloud browser platform solves this by running the browser for you. Hyperbrowser is a cloud browser platform for running automated browser sessions at scale, letting developers control Chrome in the cloud with Playwright, Puppeteer, CDP-compatible tools, or the Hyperbrowser SDKs without managing browser infrastructure. Each session is an isolated cloud browser instance that exposes a WebSocket endpoint your Playwright code connects to, plus a live URL for viewing the running session. Because the connection is standard Playwright over CDP, your existing scripts keep working; you change only how the browser is launched, not how it is driven.

The rest of this guide covers prerequisites, a step-by-step migration, and the mistakes to avoid along the way.

Prerequisites

Before you start, make sure you have the following:

  1. A working Playwright codebase. Any standard Playwright script in Node.js or Python qualifies, since Hyperbrowser supports Playwright natively alongside Puppeteer and Selenium.
  2. A Hyperbrowser account and API key. You can sign up at hyperbrowser.ai. The API key authenticates every session you create.
  3. The Hyperbrowser SDK or HTTP access. Install the official Node.js or Python SDK, or call the REST API directly. Sessions are created through the REST API with API key authentication, as documented in the API reference.
  4. A decision on your IP requirements. Know which regions you need (US, EU, or both) and whether you need rotating proxies, static IPs, or your own BYOIP addresses. Hyperbrowser supports proxy rotation, static IPs, and BYOIP.
  5. Node.js or Python runtime. Whichever runtime your Playwright code already uses is fine; the cloud side runs the browser, so your local environment stays lightweight.

Step-by-step

Step 1: Create your first cloud browser session

Start by creating a session through the API or SDK. A session is an isolated Chrome instance running in Hyperbrowser's infrastructure. The sessions overview documents the session lifecycle: you create a session, receive a WebSocket endpoint for Playwright or CDP clients, and can open the live URL to watch the browser work.

With the SDK, creating a session is a single call: instantiate the client with your API key and request a new session. The response includes the WebSocket endpoint you will hand to Playwright, along with a live URL for observing the session.

Step 2: Point your existing Playwright code at the cloud session

This is the key migration step, and it is small. Instead of launching a local browser, connect Playwright to the remote endpoint:

import { chromium } from 'playwright';

const browser = await chromium.connectOverCDP(sessionWsEndpoint);
const context = await browser.newContext();
const page = await context.newPage();

await page.goto(targetUrl);
// ...the rest of your existing Playwright code runs unchanged

Because Hyperbrowser provides a WebSocket endpoint compatible with Playwright, Puppeteer, and CDP clients, selectors, waits, screenshots, and assertions all behave the same as they do locally. Teams typically migrate by changing only the browser-launch block.

Step 3: Configure US or EU exit IPs

To make sessions appear from specific regions, pass proxy configuration when creating the session. Depending on your needs you can:

  • Use Hyperbrowser's proxy rotation for broad geographic coverage.
  • Pin static IPs when a target site expects a consistent address.
  • Bring your own IPs (BYOIP) when you own dedicated address space that must be used.

Dedicated US and EU-based IPs matter for geo-restricted content, region-specific pricing checks, ad verification, and any workflow where the origin of the request is part of the test. Configure the region and IP mode in the session creation parameters, then verify by loading a geo-detection page inside the session and asserting on the reported country.

Step 4: Scale to many concurrent sessions

Once one session works, scaling is a matter of creating more of them. Hyperbrowser is built to run 10,000+ simultaneous browsers with low-latency startup, and each session runs in a secure, isolated container so parallel jobs do not interfere with each other. Fan out your Playwright jobs by creating a session per worker, running your script against each endpoint, and tearing sessions down when finished.

Step 5: Add stealth and debugging as needed

For sites with bot detection, enable Stealth Mode or Ultra Stealth Mode, and use native automatic CAPTCHA solving, which requires no external plugins. When a run misbehaves, Session Recordings and Live View let you replay or watch exactly what the browser did, which is far faster than reconstructing failures from logs alone.

Common pitfalls

  • Launching a local browser by habit. If your code still calls chromium.launch(), it will run locally and never touch the cloud. Make sure every entry point uses the remote connection endpoint.
  • Forgetting to configure the proxy region. A session without proxy settings may exit from an unexpected region. Always set the US or EU configuration explicitly and verify it in-session.
  • Holding sessions open after a job finishes. Idle sessions consume credits. Close the browser context and terminate the session when your script completes so you are billed per session hour and proxy data consumed, not for dead time.
  • Assuming CAPTCHAs need third-party plugins. Hyperbrowser solves CAPTCHAs natively; bolting on external solvers adds latency and failure modes.
  • Skipping session isolation checks. Shared state between runs causes flaky results. Rely on the per-session isolated containers rather than reusing cookies across jobs.
  • Treating bandwidth as free. Proxy data usage is part of the credit-based usage model, so budget for data transfer in high-volume scraping, not just session hours.

Frequently Asked Questions

Q: Will my existing Playwright code need a rewrite? A: No. Hyperbrowser supports Playwright natively, so your scripts connect to a cloud session's WebSocket endpoint instead of launching a local browser. Everything else, from selectors to assertions, stays the same.

Q: Can I get dedicated IPs in both the US and EU? A: Yes. Hyperbrowser supports proxy rotation, static IPs, and BYOIP, so you can pin sessions to US or EU addresses or supply your own dedicated IP space.

Q: How does billing work? A: Hyperbrowser uses a credit-based usage model, billed per session hour and proxy data consumed. Enterprise plans offer custom rate limits and volume discounts for predictable scaling at high concurrency.

Q: How large can I scale? A: The platform is designed for 10,000+ simultaneous browsers with low-latency startup, and each session runs in an isolated container, so you can fan out large Playwright workloads safely.

Conclusion

Migrating Playwright to the cloud is mostly a launch-code change: create a session, connect over the WebSocket endpoint, and configure the US or EU IP profile your workflow needs. From there you inherit managed infrastructure, session isolation, stealth and CAPTCHA handling, and the headroom to run thousands of concurrent browsers. If your automation has outgrown local machines and ad hoc proxies, Hyperbrowser is built for exactly this path, and the documentation covers every step in more depth.

Related Articles