> ## Documentation Index
> Fetch the complete documentation index at: https://docs.augustin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Browserless

Headless Chromium-as-a-service. Replaces the old `chromium` selkies-streamed browser, which used too much RAM for how rarely it ran. Browserless is purpose-built for agents (Playwright, Puppeteer, raw CDP) and ships a Live Debugger UI for the few times a human actually needs to drive the browser.

Runs on i3 as a swarm stack.

## Endpoints

All require `?token=<TOKEN>` (set in `browserless/.env` as `BROWSERLESS_TOKEN`).

| What                        | URL                                                         |
| --------------------------- | ----------------------------------------------------------- |
| Live Debugger (interactive) | `https://browserless.augustin.ai/debugger?token=…`          |
| Pressure / health           | `https://browserless.augustin.ai/pressure?token=…`          |
| Active sessions             | `https://browserless.augustin.ai/sessions?token=…`          |
| Raw CDP (WebSocket)         | `wss://browserless.augustin.ai/?token=…`                    |
| Playwright Chromium         | `wss://browserless.augustin.ai/chromium/playwright?token=…` |

## Quick test

```bash theme={null}
source browserless/.env
curl -s "https://browserless.augustin.ai/pressure?token=$BROWSERLESS_TOKEN"
```

## Agent usage

Playwright (Python):

```python theme={null}
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(
        f"wss://browserless.augustin.ai/?token={TOKEN}"
    )
    page = browser.new_page()
    page.goto("https://example.com")
    print(page.title())
```

Puppeteer (Node):

```js theme={null}
const browser = await puppeteer.connect({
  browserWSEndpoint: `wss://browserless.augustin.ai/?token=${TOKEN}`,
});
```

## Config knobs

In `browserless/compose.yaml`:

* `CONCURRENT=5` — max parallel sessions
* `QUEUED=10` — queue depth before requests are rejected
* `TIMEOUT=120000` — per-session timeout (ms)
* `tmpfs /dev/shm 2GB` — swarm ignores `shm_size:`, so we mount a tmpfs instead. Without this, Chromium crashes under load.

No persistent storage by design — every session is clean. If a workflow needs sticky cookies, mount `/user_data` and set `DATA_DIR=/user_data`.

## Ops

```bash theme={null}
# Restart
docker service update --force browserless_browserless

# Logs
docker service logs -f browserless_browserless

# Pressure / queue health (requires token)
curl "https://browserless.augustin.ai/pressure?token=$BROWSERLESS_TOKEN"
```
