# Self-host Browserless

> Headless browser service that runs Chromium and other browsers in Docker and exposes them over WebSocket to Puppeteer and Playwright, with REST APIs for content, screenshots, PDFs and scraping. Run your own Browserless on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.

_Updated November 23, 2026_

Running your own Browserless usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Browserless behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.

## Just ask your agent

Open a Plus workspace (Browserless runs in Docker, which Plus and Pro include), tap **Launch** to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

```text
Set up Browserless on this workspace and give me the link. Follow https://envhaven.com/self-host/browserless.md
```

Then open the link it sends and create your Browserless account straight away, before anyone else finds the address. That is the whole request: the address in it is this page's Markdown copy, and the agent follows the instructions for it further down, with every setting Browserless's docs require.

## Or keep it private with Tailscale

The preview URL puts Browserless on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Browserless an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace's **Vars** pane as `TS_AUTHKEY`, and ask the agent:

```text
Set up Browserless on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/browserless.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
```

- A Tailscale container runs beside Browserless, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
- Anything other services have to reach, such as a webhook, still needs a public address. [Keep self-hosted apps private with Tailscale](https://envhaven.com/guides/self-host-privately-with-tailscale) covers both, and what Tailscale's free plan includes.

| At a glance |  |
| --- | --- |
| What it is | AI chat, models and agent tools |
| License | SSPL-1.0 OR Browserless Commercial License |
| Runs as | Docker (`ghcr.io/browserless/chromium`) |
| Memory | 4GB for a light workload of 5-10 concurrent sessions (Enterprise Docker sizing guide) ([docs](https://docs.browserless.io/enterprise/docker/best-practices.md)) |
| Plan that fits | Plus or larger |
| Web port | 3000 |
| Documentation | [docs.browserless.io/enterprise/open-source](https://docs.browserless.io/enterprise/open-source) |

## What your agent takes care of

- **Installing it.** Browserless runs from the official image, `ghcr.io/browserless/chromium`, with its data in folders under `~/apps/browserless`.
- **Putting it on an HTTPS address.** The workspace's preview URL serves it, and your own domain can too.
- **Locking it down first.** What Browserless's docs say to set before it faces the internet, below.
- **Telling you what to back up**: DATA_DIR (browser user data such as cookies, cache and local storage; defaults to the OS temp directory), DOWNLOAD_DIR (file downloads) and METRICS_JSON_PATH (metrics across restarts) ([docs](https://docs.browserless.io/enterprise/open-source)).

### The settings it needs behind a proxy

- `EXTERNAL`: Fully-qualified public URL (for example https://browserless.company.com) used when Browserless builds links, such as in the /sessions API, behind a reverse proxy; the older PROXY_URL is deprecated. ([docs](https://docs.browserless.io/enterprise/open-source))
- WebSocket upgrade headers and long read timeout in the proxy: Puppeteer and Playwright connect over WebSocket, so the proxy needs HTTP/1.1 with Upgrade and Connection headers; the NGINX guide also sets proxy_read_timeout 900. ([docs](https://docs.browserless.io/enterprise/docker/nginx-load-balancing.md))
- `TOKEN`: API token sent as ?token= on every request; no token is generated for you. ([docs](https://docs.browserless.io/enterprise/open-source))
- CORS and `CORS_ALLOW_ORIGIN`: CORS headers are off by default; when enabled the allowed origin defaults to *. ([docs](https://docs.browserless.io/enterprise/open-source))

### Before it faces the internet

- Set TOKEN before exposing the container: without it every endpoint is open, including /function, which runs arbitrary Puppeteer code from the request body. ([docs](https://docs.browserless.io/enterprise/open-source))

## Things to ask next

Everything after the install is one more sentence to the agent. Some that come up:

- "Connect it to the API keys in my Vars pane, and make Claude the default model."
- "Add a second user account for my partner, without admin rights."
- "Move Browserless to app.example.com." Add the domain on the dashboard's Domains page with a CNAME to `domains.envhaven.app`, and the agent changes Browserless's address settings to match.
- "Update Browserless to the latest release." It pulls the new image and recreates the container, data kept.

## Instructions for the agent

The agent reads these from the page's Markdown copy. They also work pasted on their own, if you would rather give them in your own words.

```text
Set up Browserless on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, ghcr.io/browserless/chromium. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- Keep the compose file in ~/apps/browserless and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Browserless's port 3000.
- The preview URL terminates HTTPS in front of Browserless: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/browserless.md for the preview URL, as Browserless's docs describe for running behind a proxy; skip any that apply only when Browserless serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/browserless.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Browserless up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.
```

## What to know

- In Docker, Browserless's containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
- Chrome needs more shared memory than Docker's default; set shm_size 2g (or --shm-size=2g). ([docs](https://docs.browserless.io/enterprise/open-source))
- Each Chrome process competes for CPU and memory; CONCURRENT (default 10) caps sessions and QUEUED (default 10) caps waiting requests. ([docs](https://docs.browserless.io/enterprise/docker/best-practices.md))
- BrowserQL, stealth and CAPTCHA solving, session recording, live debugging, webhooks and OpenTelemetry are in the Enterprise image, so the open-source image is limited to core automation. ([docs](https://docs.browserless.io/enterprise/open-source))
- Chrome and Edge images exist only for amd64, and the multi image on ARM leaves them out. ([docs](https://docs.browserless.io/enterprise/open-source))
- The licence restricts closed-source commercial, application and CI use to holders of a commercial license. ([docs](https://github.com/browserless/browserless/blob/main/LICENSE))
- A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.

## Without a workspace

The manual route, on a server you run:

1. Rent a Linux VPS, secure SSH, and create a user for the app.
2. Install Docker and write a compose file from the official image.
3. Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
4. Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
5. Keep the firewall closed except for the proxy, and schedule backups and updates.

Browserless's own [documentation](https://docs.browserless.io/enterprise/open-source) covers each step for its install methods.

## Sources

Facts about Browserless come from its own documentation, checked on 2026-11-23:

- [docs.browserless.io/enterprise/open-source](https://docs.browserless.io/enterprise/open-source)
- [github.com/browserless/browserless/blob/main/README.md](https://github.com/browserless/browserless/blob/main/README.md)
- [docs.browserless.io/enterprise/docker/best-practices.md](https://docs.browserless.io/enterprise/docker/best-practices.md)
- [docs.browserless.io/enterprise/docker/nginx-load-balancing.md](https://docs.browserless.io/enterprise/docker/nginx-load-balancing.md)
- [github.com/browserless/browserless/blob/main/LICENSE](https://github.com/browserless/browserless/blob/main/LICENSE)

## Keep reading

- [Self-host any app with your agent](https://envhaven.com/self-host)
- [Self-host Open WebUI](https://envhaven.com/self-host/open-webui)
- [Self-host LibreChat](https://envhaven.com/self-host/librechat)
- [Self-host AnythingLLM](https://envhaven.com/self-host/anythingllm)
- [Self-host Dify](https://envhaven.com/self-host/dify)
- [AI agent hosting](https://envhaven.com/guides/ai-agent-hosting)

Source: https://envhaven.com/self-host/browserless
