If you’re building an AI agent that needs to scrape websites, automate workflows, or interact with live web content, you’ve probably reached for Puppeteer + Chrome. It works, but it’s slow — Chrome takes seconds to start, burns memory like fuel, and carries state between tasks.
Lightpanda just shipped a better option. It’s a headless browser built from scratch in Zig, designed specifically for AI automation. In benchmarks, it’s 11x faster than Chrome and uses 9x less memory. It’s also compatible with Puppeteer and Playwright, so you can drop it in as a replacement.
Here’s what you need to know to use it.
What’s the Problem With Chrome?
Chrome is amazing for humans. It renders every pixel, manages history, cookies, plugins, extensions — it’s built for people who need a fully-featured browser experience.
For AI agents, that’s overhead. When you run Chrome headless, you’re paying the cost of all that human-facing code just to automate a web page. Each instance uses ~200MB of RAM. Startup takes seconds. If you’re spinning up 10 parallel agents to scrape different sites, your infrastructure bill explodes.
Lightpanda strips away the rendering, the GUI, the persistent state — and builds a browser just for machines. No graphical output. No extensions. No multi-session complexity. Just: fetch URL, execute JavaScript, extract data, move on.
The result: 2.3 seconds to scrape 100 pages (vs 25.2 seconds with Chrome + Puppeteer on the same hardware).
Installation
Lightpanda binaries are available for macOS and Linux. Get the latest nightly build:
macOS (aarch64)
curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos && \
chmod a+x ./lightpanda
Linux (x86_64)
curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux && \
chmod a+x ./lightpanda
Docker
If you want isolation and reproducibility, Lightpanda publishes official Docker images:
docker run -d --name lightpanda -p 9222:9222 lightpanda/browser:nightly
This starts Lightpanda’s Chrome DevTools Protocol (CDP) server on port 9222. You can now point Puppeteer or Playwright at it.
Using Lightpanda With Puppeteer
The fastest way to get started is with Puppeteer, the Node.js automation library. Lightpanda implements the Chrome DevTools Protocol (CDP), so Puppeteer treats it like Chrome.
Start Lightpanda in server mode:
./lightpanda serve --host 127.0.0.1 --port 9222
Then connect Puppeteer to it:
import puppeteer from 'puppeteer-core';
const browser = await puppeteer.connect({
browserWSEndpoint: 'ws://127.0.0.1:9222',
});
const context = await browser.createBrowserContext();
const page = await context.newPage();
// Navigate and scrape
await page.goto('https://example.com', { waitUntil: 'networkidle0' });
const data = await page.evaluate(() => {
return Array.from(document.querySelectorAll('a')).map(link => ({
text: link.textContent,
href: link.getAttribute('href'),
}));
});
console.log(data);
await page.close();
await context.close();
await browser.disconnect();
Key difference from standard Puppeteer: you’re not launching the browser in your script. Lightpanda runs separately, and you just connect() to it. This is actually better for agents — one long-lived Lightpanda instance can handle requests from multiple agents, or each agent can run its own instance without the startup cost.
Using Lightpanda With Playwright
Playwright also supports CDP backends. Use it the same way:
import { chromium } from 'playwright';
const browser = await chromium.connectOverCDP('ws://127.0.0.1:9222');
const context = await browser.createBrowserContext();
const page = await context.newPage();
await page.goto('https://example.com');
const title = await page.title();
console.log(title);
await browser.close();
The Real Win: Building AI Web Agents
Here’s where Lightpanda shines for your income-generating agents.
Imagine you’re building an agent that scrapes competitor pricing, monitors a job board, or automates form submissions across multiple sites. With Chrome, each parallel worker burns 200MB+. With Lightpanda, that’s down to ~24MB. You can run 10x more concurrent workers on the same hardware.
If your cloud bill was $500/month for infrastructure, you just cut it to $50.
Here’s a realistic agent skeleton:
import puppeteer from 'puppeteer-core';
async function scrapeWithAgent(urls) {
const browser = await puppeteer.connect({
browserWSEndpoint: 'ws://127.0.0.1:9222',
});
const results = [];
for (const url of urls) {
const context = await browser.createBrowserContext();
const page = await context.newPage();
try {
await page.goto(url, { waitUntil: 'networkidle0', timeout: 10000 });
// JavaScript execution — wait for dynamic content
await page.waitForSelector('.product-price', { timeout: 5000 }).catch(() => null);
const price = await page.evaluate(() => {
const el = document.querySelector('.product-price');
return el ? el.textContent.trim() : null;
});
results.push({ url, price, status: 'success' });
} catch (err) {
results.push({ url, price: null, status: 'error', error: err.message });
} finally {
await context.close();
}
}
await browser.disconnect();
return results;
}
// Usage
const urls = ['https://example1.com', 'https://example2.com'];
const data = await scrapeWithAgent(urls);
console.log(data);
This agent:
- Spins up one Lightpanda connection
- Iterates through URLs sequentially (parallelism is left to you — spawn multiple instances)
- Waits for dynamic content with
waitForSelector - Handles timeouts gracefully
- Logs status and errors for debugging
Deploy this to Railway or Render, call it on a schedule, and you’ve got a passive income stream — either selling the data, feeding it into another agent, or using it to power a SaaS product.
Lightpanda Cloud (if you don’t want to self-host)
Lightpanda’s makers also offer a cloud service. Instead of running the binary yourself, you connect to their hosted infrastructure:
const browser = await puppeteer.connect({
browserWSEndpoint: 'wss://euwest.cloud.lightpanda.io/ws?token=YOUR_TOKEN',
});
Pricing isn’t public yet (as of March 2026), but the self-hosted option is free and open-source, so unless you need enterprise scale, stick with that.
Gotchas and Limitations
Lightpanda is in beta. Here’s what to know:
JavaScript support is partial. It runs JavaScript, but not all Web APIs are implemented. If a site relies on cutting-edge browser features, it might fail. Stick with mainstream sites — news, e-commerce, content platforms.
Performance degrades on heavy SPA sites. Single-page applications with tons of JavaScript can still be slow. Lightpanda’s win is in startup time and baseline memory, not raw rendering speed. For simple scraping (HTML parsing + light JS), it’s 11x faster. For a complex React app with state management, the gap narrows.
Error messages are sparse. When something breaks, Lightpanda’s logs aren’t always helpful. Read the docs before debugging.
Telemetry is on by default. Lightpanda collects usage data. Disable it if you’re paranoid:
LIGHTPANDA_DISABLE_TELEMETRY=true ./lightpanda serve --host 127.0.0.1 --port 9222
Alternatives to Consider
Chromium-based tools (Puppeteer + Chrome, Playwright + Chrome): Fully compatible, battle-tested, slower and more expensive. Use if Lightpanda doesn’t support the sites you need.
Cheerio / jsdom: Lightweight Node.js HTML parsers with limited JavaScript support. Fast for simple scraping, useless if the page loads content dynamically.
Selenium: Legacy, slow, don’t bother.
The Verdict
If you’re building an AI agent that scrapes the web, Lightpanda is worth trying. It’s free, it’s fast, and it’s designed for exactly your use case. The API is familiar (Puppeteer/Playwright), so there’s no learning curve. The memory savings alone might make your unit economics viable.
Start with self-hosted (the binary is tiny, runs anywhere). If you hit scale, Lightpanda Cloud will be the faster path than managing your own Kubernetes cluster.
For indie developers, this is a gift. Use it.
Next Steps
- Download Lightpanda: https://github.com/lightpanda-io/browser
- Try the quick start with Puppeteer
- Benchmark against your current setup (time a real scrape job with both)
- Deploy to Railway or Render
- Build a monetized scraping agent
The infrastructure is ready. Ship it.