ShotLayer vs Self-Hosted Puppeteer: Should You Build or Buy?

Every developer thinks "I'll just spin up Puppeteer." Then come the memory leaks, zombie processes, and the 40 hours you didn't budget for. Here's the honest comparison.

True Cost Comparison

The sticker price of a VPS doesn't tell the full story. Factor in your engineering time.

Factor DIY Puppeteer ShotLayer
Server Cost $20 - $100/mo $0 - $49/mo
Setup Time 20 - 40 hours 5 minutes
Ongoing Maintenance Ongoing (Chrome updates, patches) Zero
Scaling Manual (add servers, load balancer) Automatic
Memory Management You handle it (leaks are common) Managed
Browser Pooling Build from scratch Built-in
Queue Management Build from scratch (Redis, Bull, etc.) Built-in
Monitoring & Alerts Set up yourself Dashboard included

Real Developer Pain Points

These are the problems you'll hit after "it works on my machine."

💥

Memory Crashes

Each Chrome tab uses 50-300MB of RAM. At scale, your server runs out of memory and the OOM killer strikes without warning. You'll build a memory monitor, a restart loop, and still wake up to alerts at 3am.

👻

Zombie Processes

Chromium processes that didn't close properly accumulate silently. Your server slows to a crawl. You'll write a cron job to kill orphans, then discover edge cases where it kills active renders.

40 Hours You Didn't Plan For

Font loading, timeout handling, viewport quirks, Docker configuration, headless Chrome flags, sandbox permissions. The "quick Puppeteer script" becomes a production service you now maintain forever.

📈

Scaling is Not Free

Going from 100 to 10,000 screenshots per day means load balancing, browser pools, request queuing, retry logic, and horizontal scaling. Each piece is a project in itself.

When to Choose Each

DIY Puppeteer makes sense when:

  • You need full browser automation (clicking, typing, navigation flows)
  • You're doing millions of captures per month and cost is critical
  • You have very specific rendering requirements (custom Chrome flags)
  • You're learning browser automation as a skill

ShotLayer makes sense when:

  • Screenshots or OG images are a feature, not the product itself
  • You need fewer than 100k captures per month
  • You want to ship in minutes, not weeks
  • You don't have DevOps bandwidth to maintain infrastructure
  • You'd rather spend 40 hours on your product, not on Chrome wrangling

Code Comparison

See how much code you actually need for each approach.

DIY Puppeteer (~35 lines)
const puppeteer = require('puppeteer'); async function takeScreenshot(url) { let browser; try { browser = await puppeteer.launch({ headless: 'new', args: [ '--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage', '--disable-gpu', '--single-process', ], }); const page = await browser.newPage(); await page.setViewport({ width: 1280, height: 800, }); await page.goto(url, { waitUntil: 'networkidle0', timeout: 30000, }); const screenshot = await page.screenshot({ type: 'png', fullPage: false, }); return screenshot; } catch (err) { console.error(err); } finally { if (browser) await browser.close(); } } // + Docker, queuing, monitoring...
ShotLayer (3 lines)
const response = await fetch( `https://api.shotlayer.dev/v1/screenshot?url=${url}&width=1280&format=png`, { headers: { Authorization: `Bearer ${API_KEY}` } } ); const image = await response.blob(); // That's it. No servers, no Docker, // no memory leaks, no zombie processes.

Skip the infrastructure work

Get screenshots with a single API call. Free tier included, no credit card required.

Get Your API Key →