End-to-end tests drive a real browser through your application the way a user would: log in, add to cart, pay, check the confirmation. They catch problems that unit tests miss, but they need real browsers and a fair amount of CPU. A Linux VPS is a good place to run them: always available, faster than a laptop for parallel runs, and close to your staging server. This guide uses Playwright, which supports Chromium, Firefox and WebKit from one API.
Step 1: Install Node.js and Playwright
Use a current Node.js LTS release, then add Playwright to your project (or a dedicated tests repository):
npm init playwright@latest
# or in an existing project
npm install -D @playwright/test
npx playwright install --with-deps
--with-deps installs the system libraries the browsers need on Debian and Ubuntu, which is the most common cause of "browser failed to launch" errors on a fresh server. To save time and disk, install only what you test: npx playwright install --with-deps chromium.
Step 2: Configure for a Server
// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests',
fullyParallel: true,
workers: 4, // about one per vCore
retries: 1, // retry once to spot flaky tests
timeout: 30_000,
reporter: [['html', { open: 'never' }], ['list']],
use: {
baseURL: process.env.BASE_URL ?? 'https://staging.example.com',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'mobile', use: { ...devices['Pixel 7'] } },
],
});
Headless mode is the default, so no display server is needed. Retries reveal flaky tests: a test that passes on retry is reported as "flaky", which you should fix rather than ignore.
Step 3: A Sample Test
// tests/login.spec.ts
import { test, expect } from '@playwright/test';
test('user can log in', async ({ page }) => {
await page.goto('/login');
await page.getByLabel('Email').fill(process.env.E2E_USER!);
await page.getByLabel('Password').fill(process.env.E2E_PASS!);
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible();
});
Use role- and label-based locators, which are more stable than CSS selectors, and keep test credentials in environment variables, never in the repository.
Step 4: Run and Read Results
BASE_URL=https://staging.example.com npx playwright test
npx playwright show-report --host 127.0.0.1 # view via SSH port forwarding
npx playwright show-trace test-results/**/trace.zip
The HTML report and traces show each step, network request, console message and DOM snapshot, which makes failures on a headless server easy to debug. View them on your computer through SSH port forwarding, or copy the playwright-report folder down.
Alternative: The Official Docker Image
Microsoft publishes Playwright images with browsers and dependencies preinstalled. Match the image tag to your @playwright/test version:
docker run --rm --ipc=host -v "$PWD":/work -w /work \
-e BASE_URL=https://staging.example.com \
mcr.microsoft.com/playwright:vX.Y.Z-noble \
npx playwright test
Replace vX.Y.Z with your installed version. --ipc=host is recommended for Chromium to avoid running out of shared memory. Containers keep the server clean and make runs reproducible.
Step 5: Automate Runs
- From CI: register the VPS as a self-hosted runner for GitHub Actions or GitLab CI and run the suite on every merge to the main branch.
- On a schedule: a nightly cron job runs the full suite against staging or production smoke tests (see our cron guide).
- After deploys: call the test command from your deploy script and roll back if critical tests fail.
# crontab -e (02:30 every night)
30 2 * * * cd /srv/e2e && BASE_URL=https://staging.example.com npx playwright test --reporter=line >> /var/log/e2e.log 2>&1
Send failures somewhere you will see them, for example a webhook to chat, or a heartbeat monitor that alerts when the nightly run stops reporting success (see our monitoring guide).
Making Tests Reliable
- Rely on Playwright's auto-waiting assertions (
expect(...).toBeVisible()) instead of fixed sleeps. - Give each test its own data, or reset the database before the run, so tests do not depend on each other.
- Reuse a logged-in state with
storageStateinstead of logging in through the UI in every test. - Run against staging, not production, except for read-only smoke tests.
- Keep the server close to the application under test to reduce network flakiness.
Splitting Large Suites
When one server is not enough, split the suite into shards and run them on several machines in parallel: npx playwright test --shard=1/3, --shard=2/3 and --shard=3/3. Each shard produces a blob report, and npx playwright merge-reports combines them into one HTML report. This scales test time down roughly linearly with the number of servers.
Sizing the Server
Each browser worker typically needs about one CPU core and several hundred MB to more than 1 GB of RAM depending on the pages. Start with workers equal to the vCore count and reduce them if you see timeouts or memory pressure. Clean old reports, traces and videos regularly; they use disk quickly.
SkyRainCloud Plans for This Workload
Each headless browser worker uses roughly a CPU core and several hundred MB to over 1 GB of RAM under load. A 4 vCore / 16 GB server runs four parallel workers comfortably; scale vCores with the number of workers you want.
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.
Frequently Asked Questions
Can Playwright run on a Linux server without a display?
Why does the browser fail to launch on my VPS?
npx playwright install --with-deps, or use the official Playwright Docker image, which includes them.How many parallel workers can I run?
Should I use Docker for Playwright?
--ipc=host for Chromium.How do I debug a failing test on a headless server?
npx playwright show-trace. Traces include screenshots, DOM snapshots, network and console logs for every step.Should end-to-end tests run against production?
How do I run Playwright from GitHub Actions on my VPS?
npx playwright test.How do I stop flaky tests?
Can Playwright test mobile layouts?
Which SkyRainCloud plan suits a Playwright test server?
Related Guides
- How to Schedule Tasks on a Linux VPS with Cron
- How to Deploy Docker Containers on a VPS Server
- How to Set Up Monitoring and Logging for Applications on a VPS
- How to Set Up a Remote Linux Development Environment on a VPS
- Selenium Web Scraping VPS India from ₹1,299
- Linux VPS Hosting Pricing India — KVM VPS India