← All Articles

Setting Up Browser Instances for AI & Scraping

My go-to setup for spawning and managing browser instances at scale for scraping or AI agent use.

2025-05-04less than a minute read
Setting Up Browser Instances for AI & Scraping

If you’re running scraping tasks or AI agents that need to browse the web, you don’t want to spawn a browser from scratch every time. You want an army—pre-spawned, ready, and manageable. Here’s the setup I keep coming back to.

1. A Beefy Server

RAM is the bottleneck. I usually go for a dedicated machine with as much memory as possible—at least 64GB. No GPU needed, just solid cores and space to breathe.

2. Residential Proxies

Datacenter IPs don’t cut it anymore. I use residential proxies behind a simple load balancer. Nothing fancy—just enough rotation to avoid blocks.

3. Pre-Spawned Puppeteer Pool

I spin up as many Puppeteer instances as the RAM can handle. These sit idle, headless, and waiting. Cold starts are expensive—better to keep the pool warm.

4. Remote Debugging + Liveness

Each browser exposes a WebSocket endpoint using remote debugging. I run a small script that keeps them subscribed to a central “heartbeat,” so I know which ones are alive and which ones died silently.

5. Use, Kill, Respawn

On request:

  • Pick an available instance
  • Lock it
  • Run your task
  • Kill it
  • Spawn a new one

Memory leaks? Don’t debug. Just destroy and replace. Works better long-term.


This setup has held up across scraping workloads, agent testing, even some UI testing setups. Clean. Reusable. Disposable.