← Blog

BLOG

Cloud Browser Online: Run Real Chromium in the Cloud

A cloud browser online gives you a real Chromium session over CDP with no local install. Learn how it works, what to check, and how to connect Playwright.

8 min readRemote Browser
Ivory computer towers connected across terracotta platforms in a quiet desert landscape
The infrastructure behind your browserREMOTE BROWSER / ILLUSTRATION

A cloud browser online is a real Chromium instance running on someone else's servers that you control over the network instead of launching it on your laptop or CI box. You get a WebSocket endpoint, connect over the Chrome DevTools Protocol (CDP), and drive pages with Playwright, Puppeteer, Selenium, or an agent framework. Nothing installs locally, and the browser keeps running even when your script, container, or laptop stops.

That definition matters because "cloud browser online" gets used for two different things: a hosted Chromium runtime you connect to programmatically, and a consumer remote-desktop browser you click around in. This guide is about the first kind — the runtime layer that AI agents and automation pipelines actually need — and it covers how it works, where it breaks, and how to wire one up without surprises.

What "cloud browser online" actually means

The phrase describes three properties at once:

  • Cloud — the browser process runs on a provider's infrastructure, not your machine. You never install Chrome, manage a display server, or patch a Chromium build.
  • Browser — it is a genuine browser engine (Chromium in most cases), not an HTTP client or a headless rendering service. JavaScript executes, cookies persist, and the DOM behaves like a real page load.
  • Online — it is reachable over the network through a stable endpoint, typically a CDP WebSocket URL, for the life of the session.

A hosted runtime like Remote Browser packages those three properties with session isolation, persistent profiles, a live viewer, and usage controls. You request a session, get a connection URL, and attach your automation client. When you are done, you release the session and stop paying for it.

This is different from a browser-as-a-service that only exposes a screenshot or a scraping API. With CDP access, you keep full control over navigation, input, network interception, and evaluation — the same primitives you would have with a local chromium.launch().

Why teams move off local Chrome

Local Chrome works fine for a single script on a developer machine. It stops working well when you need any of the following:

  • Concurrency. Ten parallel agents on one laptop means ten Chromium processes competing for RAM and CPU. A hosted runtime gives each session its own isolated browser.
  • Persistence across workers. If your agent runs in a serverless function or a rotating container, local browser state dies with the worker. Persistent profiles on a hosted runtime survive restarts.
  • Consistent environments. Local Chromium versions drift between machines. A hosted runtime pins the browser build so behavior is reproducible.
  • Observability. Debugging a headless run is painful without a live view. A hosted session with a viewer lets you watch and intervene in real time.
  • Network posture. Proxies and configurable browser settings are easier to apply centrally than per-machine.

The trade-off is latency and dependency: every action crosses the network, and you now rely on a provider's uptime. For most agent workloads that is acceptable; for sub-100ms interaction loops it may not be.

How a cloud browser session works

The lifecycle is short and predictable:

  1. Create a session. You call the provider's API with options — viewport, proxy, profile, timeout. You get back a session ID and a CDP WebSocket endpoint.
  2. Connect. Your client attaches over CDP. Playwright uses connectOverCDP; Puppeteer uses connect with browserWSEndpoint.
  3. Drive. You create pages, navigate, click, type, and evaluate exactly as with a local browser.
  4. Observe. A live viewer streams the session so a human can watch or take over.
  5. Release. You close the session. Billing stops; the profile can be saved for reuse.

The CDP endpoint is the contract. Everything else — the viewer, the profile store, the proxy layer — sits around it. If your client speaks CDP, it works. That is why the same session can serve a Playwright test, a Puppeteer scraper, and an LLM-driven agent without changes to the runtime.

For a deeper look at the runtime layer itself, see Remote browsers for AI agents.

Connecting with Playwright over CDP

The most common integration is Playwright's connectOverCDP. It attaches to an existing browser rather than launching one, which is exactly what a hosted session needs.

import { chromium, type Browser, type Page } from "playwright";

interface SessionInfo {
  cdpUrl: string;
  sessionId: string;
}

async function openCloudSession(): Promise<SessionInfo> {
  // Replace with your provider's session-creation endpoint.
  const res = await fetch("https://api.remote-browser.dev/v1/sessions", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${process.env.REMOTE_BROWSER_API_KEY}`,
    },
    body: JSON.stringify({
      viewport: { width: 1280, height: 800 },
      timeoutSeconds: 600,
    }),
  });

  if (!res.ok) {
    throw new Error(`Session create failed: ${res.status} ${await res.text()}`);
  }

  const data = await res.json();
  return { cdpUrl: data.cdpUrl, sessionId: data.id };
}

async function run(): Promise<void> {
  const { cdpUrl, sessionId } = await openCloudSession();
  let browser: Browser | undefined;

  try {
    browser = await chromium.connectOverCDP(cdpUrl);

    // connectOverCDP reuses the existing context; grab it rather than
    // calling newContext(), which throws on some providers.
    const context = browser.contexts()[0] ?? (await browser.newContext());
    const page: Page = context.pages()[0] ?? (await context.newPage());

    await page.goto("https://example.com", { waitUntil: "domcontentloaded" });
    const title = await page.title();
    console.log("Loaded:", title);

    await page.getByRole("link", { name: /more information/i }).click();
    await page.waitForLoadState("networkidle");
  } finally {
    // Closing the browser disconnects the client; the provider
    // releases the session on its own timeout or via an explicit call.
    await browser?.close();
    await fetch(`https://api.remote-browser.dev/v1/sessions/${sessionId}`, {
      method: "DELETE",
      headers: { Authorization: `Bearer ${process.env.REMOTE_BROWSER_API_KEY}` },
    });
  }
}

run().catch((err) => {
  console.error(err);
  process.exit(1);
});

Two details trip people up. First, connectOverCDP returns a browser whose default context already exists — calling newContext() on it can throw depending on the provider's Chromium flags. Reuse browser.contexts()[0]. Second, browser.close() disconnects your client but does not always terminate the remote session; release it explicitly so you are not billed for an idle browser.

The Playwright `connectOverCDP` documentation covers the endpoint format and the Chromium-only caveat. If you need the raw protocol, the Chrome DevTools Protocol docs describe the domains your client is speaking.

What to evaluate before you commit

Not every hosted runtime is built for production agent workloads. Score candidates against these criteria.

CriterionWhy it mattersWhat to check
CDP accessDetermines which clients workFull WebSocket endpoint, not a screenshot-only API
Session isolationPrevents cross-tenant data leaksOne browser per session, no shared profile by default
Persistent profilesKeeps logins and cookies across runsExplicit save/load, not implicit global state
Live viewerDebugging and human handoffReal-time stream with input control
Proxy and network settingsGeo and IP requirementsConfigurable per session, not global
Browser version pinningReproducible behaviorDocumented Chromium build, upgrade policy
Usage controlsCost predictabilityPer-session timeouts, concurrency limits, metering
Compliance postureEnterprise procurementSOC 2, data retention policy, region options

Two rows deserve emphasis. Session isolation is the one people skip until an incident. If two agents share a profile, one agent's cookies leak into the other's run. Confirm that a fresh session starts clean unless you explicitly attach a saved profile. Usage controls determine whether your bill is predictable. A runtime that meters per browser-hour with hard timeouts is easier to reason about than one that bills on vague "compute units." Check pricing for the current model rather than assuming.

Common failure modes and how to handle them

Even a well-run cloud browser online hits predictable problems. Plan for these:

  • Stale CDP connections. Long-running agents can drop the WebSocket. Add reconnect logic with backoff, and treat a failed connectOverCDP as a signal to create a new session rather than retry forever.
  • Timeout drift. A session that idles past its timeout gets reclaimed mid-task. Set your client-side timeout below the provider's session timeout so you fail fast and cleanly.
  • Profile bloat. Persistent profiles accumulate storage over time. Rotate or reset profiles periodically, and never share one across unrelated tasks.
  • Detection. Some sites treat datacenter IPs and headless signals differently. Configurable browser settings and proxies help, but no runtime guarantees bypassing a target's defenses — treat stealth as a configuration surface, not a promise.
  • Version skew. If your Playwright version expects a newer CDP feature than the hosted Chromium exposes, calls fail at runtime. Pin both sides and test upgrades in staging.

For a broader comparison of runtime options, the remote web browser guide walks through the alternatives.

When a cloud browser is the wrong choice

Hosted Chromium is not universal. Skip it when:

  • You need sub-50ms interaction loops. Network round-trips dominate; a local browser wins.
  • You are doing pure static scraping. An HTTP client with a parser is cheaper and faster than a full browser.
  • You need a specific browser engine. Most hosted runtimes are Chromium-only. If you require Firefox or WebKit behavior, confirm support before committing.
  • Your data cannot leave your network. Some regulated workloads require self-hosted infrastructure. Check whether the provider offers on-prem or a private region.

Being honest about these boundaries is part of choosing well. A runtime that fits 80% of your workloads and fails the other 20% is still a good runtime — as long as you know which is which.

Getting started

The fastest path is to create a session, connect with the snippet above, and watch it in the live viewer while you build. Start with a single session and a short timeout, confirm your client attaches and navigates, then scale concurrency once the basics are stable.

  • Read the documentation for session creation, profiles, and proxy configuration.
  • Review pricing to understand how browser-hours are metered.
  • If you are driving sessions from an agent rather than a script, see remote control browser for the control-loop patterns that hold up in production.

A cloud browser online removes the operational weight of running Chromium yourself. The work that remains — session lifecycle, profile hygiene, timeout discipline, and honest evaluation of where hosted fits — is the part that actually determines whether your automation is reliable.