---
title: "Deploy Playwright Node.js Browser Automation"
description: "[Jul'26] Playwright with TypeScript, Express, OpenAPI & validation stack"
category: "Starters"
url: https://railway.com/deploy/playwright-with-nodejs
---

# Deploy Playwright Node.js Browser Automation

[Jul'26] Playwright with TypeScript, Express, OpenAPI & validation stack

**[Deploy Playwright Node.js Browser Automation on Railway](https://railway.com/template/playwright-with-nodejs)**

- **Creator:** codestorm
- **Category:** Starters
- **Total deploys:** 15

## Template content

### playwright-nodejs https://devicons.railway.app/nodejs

- **Source:** codestorm-official/playwright-with-nodejs
- **Public domain:** Yes

## Documentation

![Docker](https://img.shields.io/badge/Docker-Supported-blue?logo=docker)
# Deploy and Host Playwright with Node.js on Railway

Playwright with Node.js is a browser automation and web scraping template built with Express, TypeScript, and Playwright Chromium. It provides a production-oriented API for scraping demo pages, running smoke tests, checking service health, and exploring endpoints through Swagger/OpenAPI documentation.

![](http://raw.githubusercontent.com/codestorm-official/playwright-with-nodejs/refs/heads/main/img/docs.png)

## About Hosting Playwright with Node.js

Hosting Playwright with Node.js involves running a Node.js API that can launch and control a headless Chromium browser in a server environment. This template is designed for deployment-friendly browser automation workloads, including scraping test pages, validating site availability, and exposing structured API endpoints for automation tasks. It includes Express routing, controller and service layers, request validation, logging, rate limiting, security middleware, and a Docker image that installs Playwright browser dependencies reliably for production-style deployments.

### How to Use

After deploying this template, the app is already running on Railway. You can open the generated Railway domain to test the starter app immediately.

If you want to customize the source code, use one of the workflows below.

#### Via Railway CLI

Use this workflow if you want to edit the project locally and redeploy changes directly from your machine using Railway CLI.

1. Deploy the template.
2. Clone the repository from **Source Repo** or **Upstream Repo** in the Railway dashboard.
3. Enter the project directory:

```bash
cd 
```

4. Link your local project directory to the deployed Railway project:

```bash
railway link
```

5. Check the linked project, environment, service, and repository information:

```bash
railway status
```

6. Edit the code locally.
7. Redeploy your local changes to Railway:

```bash
railway up
```

Railway will upload the current local directory and deploy it to the linked service.

#### Via Git / GitHub

Use this workflow if you want to manage changes through GitHub and let Railway automatically redeploy after every push.

1. Deploy the template.
2. Open **Source Repo** or **Upstream Repo** from the Railway dashboard.
3. Fork the repository to your own GitHub account.
4. Clone your fork locally:

```bash
git clone 
cd 
```

5. Edit the code locally.
6. Commit and push your changes to your fork:

```bash
git add .
git commit -m "Customize Node.js starter"
git push origin main
```

7. In Railway, change the service **Source Repo** to your fork if Railway does not automatically create or link it.
8. After the service is connected to your fork, future pushes to the repository can trigger automatic redeployments.

## Common Use Cases

* Web scraping APIs that collect structured data from public test pages or e-commerce demo pages
* Browser automation services for smoke tests, QA checks, and workflow validation
* Playwright-backed API endpoints for internal tools, demos, or automation experiments

## Dependencies for Playwright with Node.js Hosting

* Node.js 20+
* npm
* Playwright Chromium
* Express
* TypeScript
* Docker, recommended for container-based deployment

### Deployment Dependencies

* [Railway](https://railway.com/)
* [Playwright](https://playwright.dev/)
* [Node.js](https://nodejs.org/)
* [Express](https://expressjs.com/)
* [Swagger UI Express](https://www.npmjs.com/package/swagger-ui-express)
* [Docker](https://www.docker.com/)

### Implementation Details

This template exposes a production-oriented API with Swagger documentation and health monitoring.

Useful routes after deployment:

```text
/                 -&gt; redirects to /docs
/health           -&gt; service health check
/docs             -&gt; Swagger UI
/openapi.json     -&gt; OpenAPI JSON
/api/scrape/sites -&gt; scrape available test site links
/api/scrape/ecommerce/products?limit=10 -&gt; scrape demo e-commerce products
/api/scrape/run   -&gt; run a scrape task
/api/tests/smoke  -&gt; run a smoke test
```

Example scrape request:

```http
POST /api/scrape/run
Content-Type: application/json

{
  "target": "ecommerce",
  "limit": 10
}
```

Recommended environment variables:

```env
NODE_ENV=production
PORT=3000
HOST=0.0.0.0
LOG_LEVEL=info
CORS_ORIGIN=*
SCRAPER_BASE_URL=https://webscraper.io/test-sites
SCRAPER_ECOMMERCE_URL=https://webscraper.io/test-sites/e-commerce/allinone
PLAYWRIGHT_HEADLESS=true
PLAYWRIGHT_TIMEOUT_MS=30000
SCRAPER_MAX_LIMIT=50
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX=60
```

For production use, configure `CORS_ORIGIN`, set `LOG_LEVEL` to `warn` or `error`, monitor `/health`, and commit `package-lock.json` for deterministic builds.

## Why Deploy Playwright with Node.js on Railway?



Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Playwright with Node.js on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.




## Similar templates

- [open-excalidraw](https://railway.com/deploy/open-excalidraw) — Self-hostable collaborative drawing built on Excalidraw
- [caring-vibrancy](https://railway.com/deploy/caring-vibrancy) — Deploy and Host caring-vibrancy with Railway
- [Appsmith](https://railway.com/deploy/appsmith-1) — Low-code platform for internal tools, dashboards, and admin panels.

Open this page in a browser: https://railway.com/deploy/playwright-with-nodejs
