Deploy Browserless | Headless Chrome v2, Pinned and Token-Protected
Browserless v2 pinned, token-protected headless Chrome as a service
Browserless
Just deployed
Deploy and Host Browserless on Railway
Headless Chrome as a service - Browserless v2, pinned, behind a generated token.
About Hosting Browserless
The Browserless template on Railway is literally called "Browserless v1", and that is the problem. Upstream moved to v2 in 2023; v1 stopped at 1.61.1 and receives nothing - no Chrome updates, no security fixes. It also builds from a repository rather than the published image, which is why about one deployment in six fails.
This one runs the official v2 image at a pinned version, with a generated token and sane concurrency limits.
Common Use Cases
- Rendering pages to PDF or screenshots from your own backend
- Running Puppeteer or Playwright without shipping Chrome inside your app image
- Scraping and automated checks, with a queue in front so a burst does not exhaust memory
Dependencies for Browserless Hosting
- Nothing. One service, no database.
Deployment Dependencies
- Documentation: https://docs.browserless.io
- Source: https://github.com/browserless/browserless
Implementation Details
Everything is behind TOKEN. Requests without it are refused with 401 - which matters more here than for most services: an open Browserless instance is a free browser that anyone on the internet can point at any URL, billed to you.
| Variable | Why |
|---|---|
| TOKEN | Generated. Required on every request as ?token= or a header |
| CONCURRENT | Sessions running at once - each is a Chrome instance, so this is your memory ceiling |
| QUEUED | Requests waiting for a slot before the service starts rejecting |
| TIMEOUT | Milliseconds before a session is killed; stops a hung page holding a slot forever |
| CORS | Allows browser-side calls |
Quick check once it is up:
curl "https://your-domain/json/version?token=YOUR_TOKEN"
curl -X POST "https://your-domain/pdf?token=YOUR_TOKEN" \
-H "content-type: application/json" -d '{"url":"https://example.com"}' -o page.pdf
Connect Puppeteer with puppeteer.connect({ browserWSEndpoint: "wss://your-domain?token=YOUR_TOKEN" }).
Sizing note: each concurrent session is a Chrome process. CONCURRENT=5 on a small instance is a reasonable start; raise it and watch memory before assuming it scales.
Why Deploy Browserless on Railway?
Chrome and its dependencies stay out of your application image, the service scales separately from your app, and TLS on the domain means wss:// works without extra configuration.
Template Content
Browserless
ghcr.io/browserless/chromium:v2.55.0