
Lightpanda Cloud: how do I generate a token and connect to the remote CDP WebSocket endpoint?
Most automation stacks hit the same wall the moment they try to run Chrome at scale in the cloud: multi‑second cold starts, hundreds of megabytes of RAM per instance, and brittle lifecycle management across thousands of containers. Lightpanda Cloud exists to remove that drag. You still connect over Chrome DevTools Protocol (CDP) from Playwright, Puppeteer, or chromedp—but the browser on the other side is built from scratch for machines, with instant startup and a tiny footprint.
This guide walks you through, end to end, how to:
- Generate your Lightpanda Cloud token
- Pick the right remote CDP WebSocket endpoint
- Connect from your existing CDP clients (Playwright, Puppeteer, chromedp)
- Verify everything is working and follow responsible automation norms
1. Create your Lightpanda account and generate a token
Lightpanda Cloud uses a single token per account to authenticate all your CDP WebSocket connections.
Step 1: Sign up
- Go to https://lightpanda.io.
- Create an account using your email.
After signup, you’ll receive an invitation email prompting you to generate your token.
Step 2: Generate your token (and save it)
- Follow the link in the invitation email.
- Generate your token from the page you’re taken to.
Important constraints:
- The token is shown only once.
- Copy it immediately.
- Store it somewhere secure (password manager, secret manager, or environment variable).
- You’ll use this token both:
- In your CDP WebSocket URL as
?token=YOUR_TOKEN - To log in to the console at https://console.lightpanda.io
- In your CDP WebSocket URL as
If you lose the token, you’ll need to regenerate a new one and update all your scripts.
2. Understand the Cloud CDP WebSocket endpoints
Lightpanda Cloud exposes regioned CDP WebSocket endpoints you connect to from your automation code. From your client’s perspective, it looks like a standard remote Chrome DevTools endpoint—except it’s backed by a headless-first, Zig-based browser instead of Chrome.
Region endpoints
You currently have two regions:
- West Europe:
wss://euwest.cloud.lightpanda.io/ws - West US:
wss://uswest.cloud.lightpanda.io/ws
Pick the region closer to your target sites or your application servers to minimize latency.
Token as a query parameter
Every connection must include your token as a query string parameter:
- West Europe:
wss://euwest.cloud.lightpanda.io/ws?token=YOUR_TOKEN - West US:
wss://uswest.cloud.lightpanda.io/ws?token=YOUR_TOKEN
That full URL is your browserWSEndpoint / endpointURL in CDP clients.
3. Connect to Lightpanda Cloud using Playwright
If you’re already using Playwright, you don’t rewrite your scripts—you just swap the connection string to point to Lightpanda’s CDP WebSocket.
Minimal Playwright connection example
import playwright from "playwright-core";
(async () => {
const browser = await playwright.chromium.connectOverCDP(
"wss://euwest.cloud.lightpanda.io/ws?token=YOUR_TOKEN",
);
const context = await browser.newContext();
const page = await context.newPage();
await page.goto("https://example.com", { waitUntil: "networkidle" });
console.log(await page.title());
await page.close();
await context.close();
await browser.close();
})();
Key points:
- Use
playwright-corewhen you’re connecting to a remote browser. connectOverCDPis the crucial call; the rest of your script remains the same.- You can switch to the US region just by changing the URL:
const browser = await playwright.chromium.connectOverCDP(
"wss://uswest.cloud.lightpanda.io/ws?token=YOUR_TOKEN",
);
From here, you can run your existing Playwright flows (navigation, clicks, form submissions, assertions) on top of Lightpanda’s cloud browser.
4. Connect from Puppeteer using the CDP WebSocket
Puppeteer also supports connecting to an existing CDP endpoint rather than launching Chrome locally. That’s the exact integration surface Lightpanda exposes.
Puppeteer connection example
import puppeteer from "puppeteer-core";
(async () => {
const browser = await puppeteer.connect({
browserWSEndpoint: "wss://euwest.cloud.lightpanda.io/ws?token=YOUR_TOKEN",
});
const page = await browser.newPage();
await page.goto("https://example.com", { waitUntil: "networkidle0" });
console.log(await page.title());
await page.close();
await browser.close();
})();
You still use the usual Puppeteer API: newPage, goto, selectors, etc. The only difference is that you never call puppeteer.launch(). Lightpanda Cloud handles the browser lifecycle behind the WebSocket.
5. Connect from chromedp (Go) over CDP
In Go, chromedp can also attach to an existing CDP endpoint. This is useful if you already have infrastructure written around chromedp and want to drop Chrome’s cloud baggage.
chromedp connection example
package main
import (
"context"
"log"
"time"
"github.com/chromedp/chromedp"
)
func main() {
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
defer cancel()
allocatorCtx, cancelAllocator := chromedp.NewRemoteAllocator(
ctx,
"wss://euwest.cloud.lightpanda.io/ws?token=YOUR_TOKEN",
)
defer cancelAllocator()
taskCtx, cancelTask := chromedp.NewContext(allocatorCtx)
defer cancelTask()
var title string
if err := chromedp.Run(taskCtx,
chromedp.Navigate("https://example.com"),
chromedp.Title(&title),
); err != nil {
log.Fatal(err)
}
log.Printf("Page title: %s", title)
}
Again, only the connection wiring changes. Your task definitions (chromedp.Navigate, chromedp.Click, etc.) stay the same.
6. Choose between Lightpanda and Chromium in Cloud
In Lightpanda Cloud you have access to:
- The Lightpanda browser — the machine-first engine with:
- Instant startup
- Minimal memory footprint
- Headless-only execution (no rendering overhead)
- Chromium — a more traditional fallback for edge cases that require full Chrome semantics
The selection is handled server-side, while your client continues to speak CDP. This lets you default to Lightpanda’s performance but keep a path for sites that are deeply tied to Chromium-specific quirks.
Benchmarks from our own infrastructure (Puppeteer, 100 pages, AWS EC2 m5.large) show Lightpanda completing runs ~11× faster (2.3s vs 25.2s) and using ~9× less memory (24MB vs 207MB) compared to Headless Chrome. Those are the deltas you’re essentially unlocking when you wire your CDP connections to Lightpanda Cloud.
7. Verify your setup via the Lightpanda console
Once your scripts are running against the Cloud endpoints, you can inspect recent sessions in the dashboard.
- Go to https://console.lightpanda.io.
- Log in using:
- Your email
- Your token
- In the console, review:
- Recent browsing sessions
- Basic run metadata
This is especially useful when you’re first migrating from local Chrome/Playwright/Puppeteer to the remote CDP WebSocket and want to confirm connections are being established correctly.
8. Responsible automation: robots.txt and rate awareness
A browser that starts instantly and uses very little memory is powerful—but it also makes it easier to overload targets if you’re not careful. Lightpanda is explicit about responsible automation:
- Respect
robots.txt.
In the CLI, you can enforce this via flags like--obey_robots. For Cloud-based CDP sessions, mirror the same behavior in your scheduling/orchestration layer. - Control request rate.
Multi-second cold starts are no longer hiding your concurrency. If you fan out aggressively, you can create a DDoS pattern fast. Use:- Delays between requests
- Concurrency caps per origin
- Backoff on errors or elevated latency
Machine-first browsers make large-scale crawling, testing, and agent workloads cheaper and more responsive. They also increase your responsibility to stay within acceptable load boundaries.
9. Telemetry and privacy controls
Lightpanda is transparent about telemetry:
- Core browser telemetry is documented in the privacy policy.
- You can opt out in environments where you run the binary directly using:
export LIGHTPANDA_DISABLE_TELEMETRY=true
For the Cloud offer, data handling and retention are documented; the key point is that the core browser remains open source and inspection-friendly, and the telemetry footprint is explicitly controllable when you run it yourself.
10. When to move from local Chrome to Lightpanda Cloud
If any of these are familiar, wiring your CDP clients to Lightpanda Cloud is usually an immediate win:
- Cold starts from Headless Chrome dominate your job runtime.
- Memory pressure from many concurrent Chrome containers is forcing you to overprovision nodes.
- You’re running large-scale crawlers, test suites, or agents and need predictable, isolated environments per session.
The migration path is intentionally simple:
- Generate a token.
- Swap your
browserWSEndpoint/connectOverCDPURL to:wss://euwest.cloud.lightpanda.io/ws?token=YOUR_TOKENorwss://uswest.cloud.lightpanda.io/ws?token=YOUR_TOKEN
- Keep the rest of your Playwright/Puppeteer/chromedp code the same.
You get the performance of a fresh, headless-only engine purpose-built in Zig, without rewriting your automation stack.