Teams use browser automation for many legitimate tasks: generating PDFs and screenshots from HTML, end-to-end testing, monitoring that critical user journeys work, filling internal web forms that have no API, and archiving pages. Running these on a VPS gives a stable, always-on environment with predictable costs. Browsers are heavy programs, though, so a little engineering makes the difference between a reliable service and a server that runs out of memory.
Choosing a Tool
| Tool | Languages | Notes |
|---|---|---|
| Playwright | JavaScript/TypeScript, Python, Java, .NET | Chromium, Firefox and WebKit; auto-waiting; isolated browser contexts |
| Puppeteer | JavaScript/TypeScript | Chrome and Firefox; widely used for PDFs and screenshots |
| Selenium WebDriver | Many languages | W3C WebDriver standard; works with Selenium Grid for distribution |
For end-to-end testing, see our Playwright testing guide.
Server Setup
- Install browsers through the tool (for example
npx playwright install --with-deps chromium), which also installs required system libraries on supported distributions. - Install fonts, including fonts for Indian scripts (such as Noto fonts) and emoji, or text in screenshots and PDFs will render as boxes.
- Run headless; for the rare case needing a headed browser, use a virtual display such as Xvfb.
- Run automation as a dedicated non-root user.
Running in Docker
Official images (such as Playwright's) include browsers and dependencies at matching versions. Chromium uses /dev/shm for shared memory, and Docker's small default can cause crashes, so increase it with --shm-size or follow the tool's recommended settings. Keep the browser sandbox enabled by running as a non-root user where possible, and set memory limits on the container so a runaway browser cannot affect the rest of the server.
Memory and Concurrency
A headless browser commonly uses hundreds of megabytes, and heavy pages can use much more. Concurrency, not request rate, decides the server size.
- Launch one browser per worker process and create a new context (an isolated, incognito-like session) per task, which is much cheaper than launching a browser each time.
- Limit concurrent pages per worker, and limit worker count to what memory allows.
- Restart browsers periodically (for example after a few hundred tasks) to release memory that builds up.
- Block unnecessary resources (ads, large media) for tasks that do not need them.
Run Automation as Jobs
Do not launch browsers inside web requests. Put tasks on a queue and let workers with fixed concurrency process them, returning results through a callback or status endpoint (see our background workers guide). This protects the server from traffic spikes and makes retries and timeouts manageable. PDF generation pipelines are covered in our file processing guide.
Reliability
- Set timeouts for navigation and each action, plus an overall job timeout.
- Close pages, contexts and browsers in
finallyblocks so errors do not leak processes. - Run a periodic check for orphaned browser processes and kill them.
- Prefer stable selectors (roles, labels, test IDs) over fragile CSS paths.
- Save screenshots and traces on failure for debugging.
- Retry transient failures with backoff, but not failures caused by changed pages.
Responsible Automation
Automate only sites and systems you are allowed to use this way. Read and follow terms of service and robots.txt where relevant, prefer official APIs when they exist, keep request rates low, identify your automation honestly where appropriate, and never use automation to bypass security controls, access accounts you are not authorised to use or collect personal data unlawfully. Under Indian data protection law and others, collecting personal data carries obligations.
Security
- Keep browsers updated; they process untrusted content and receive frequent security fixes.
- Do not render arbitrary user-supplied URLs without restrictions, since that can be used to reach internal services; block private IP ranges and metadata addresses.
- Store credentials for automated logins in a secrets store, not in scripts.
- Isolate automation from production databases and secrets.
Monitoring
Track queue depth, job duration percentiles, failure rate by task type, memory and CPU usage, and the number of running browser processes. A steady rise in browser processes signals a leak; rising durations often mean pages got heavier or concurrency is too high.
Sizing
| Workload | Suggested plan |
|---|---|
| Occasional screenshots, PDFs, a few monitoring journeys | 2 vCores / 8 GB |
| Steady PDF generation or several parallel sessions | 4 vCores / 16 GB |
| Large test suites or high-volume rendering | 8 vCores / 32 GB, or several worker servers |
Measure memory per session with your real pages, then set concurrency so peak usage leaves headroom. CPU-heavy rendering benefits from more cores (see our heavy CPU workloads guide).
Example: Invoice PDFs and Journey Checks
A SaaS company runs Playwright workers on a 4 vCore / 16 GB VPS. One queue renders invoice PDFs from HTML templates with four concurrent contexts; another runs login and checkout journeys every ten minutes against their own app, alerting on failure with a screenshot. Browsers restart every 300 jobs, and a cron job kills any orphaned browser older than an hour.
Common Mistakes
- Launching a new browser for every task.
- Unlimited concurrency until memory runs out.
- Missing fonts, producing broken PDFs.
- Leaked browser processes after errors.
- Automating sites in ways their terms do not allow.
In Short
Use Playwright, Puppeteer or Selenium on a properly prepared server, run automation as queued jobs with fixed concurrency, reuse browsers with fresh contexts, clean up every process, automate responsibly and monitor memory.
SkyRainCloud Plans for This Workload
Each headless browser needs memory and CPU. 2 vCores / 8 GB runs a few browsers at once; 4–8 vCores with 16–32 GB suits many parallel sessions for screenshots, PDFs or testing.
AMD EPYC 7C13 VPS
Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — AMD | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Websites, small APIs, bots, staging and VPN servers | Order |
| VPS 2 — AMD | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,299/month | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| VPS 3 — AMD | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,499/month | Production databases, high-traffic sites, multi-container apps | Order |
| VPS 4 — AMD | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,899/month | Large production workloads, SaaS platforms, analytics, in-memory caches | Order |
Intel Xeon Platinum 8269CY VPS
KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — Intel | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Business websites, small apps, scheduled jobs and bots | Order |
| VPS 2 — Intel | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,169/month | Business software, mid-size databases, several sites on one server | Check stock |
| VPS 3 — Intel | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,249/month | ERP/CRM stacks, heavier databases, multiple production apps | Check stock |
| VPS 4 — Intel | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,299/month | High-memory workloads and consolidated production servers | Check stock |
Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.