Guides

Self-Hosting

BrowseFleet is fully open-source and designed to run on your own infrastructure. A single Docker container includes everything: the API server, Chrome, and all dependencies.

Quick Start with Docker

bash
docker run -d \
  --name browsefleet \
  -p 3000:3000 \
  --shm-size=2g \
  -e API_KEYS=bf_your_secret_key \
  -e MAX_CONCURRENT_SESSIONS=10 \
  -v browsefleet-data:/data \
  ghcr.io/therj/browsefleet

Docker Compose

yaml
services:
  browsefleet:
    image: ghcr.io/therj/browsefleet
    ports:
      - "3000:3000"
    environment:
      - PORT=3000
      - HOST=0.0.0.0
      - API_KEYS=bf_your_secret_key
      - MAX_CONCURRENT_SESSIONS=30
      - STEALTH_DEFAULT=full
      - LOG_LEVEL=info
      - CHROME_PATH=/usr/bin/chromium
      - DATA_DIR=/data
      - CDP_EXTERNAL_HOST=your-server.example.com
      - CDP_EXTERNAL_PORT=3000
      - CDP_EXTERNAL_SCHEME=ws
    volumes:
      - browsefleet-data:/data
    shm_size: '2gb'
    deploy:
      resources:
        limits:
          memory: 8G
    restart: unless-stopped

volumes:
  browsefleet-data:

Environment Variables

VariableDefaultDescription
PORT3000HTTP server port
HOST0.0.0.0Server bind address
API_KEYS(empty)Comma-separated API keys. Empty disables auth.
MAX_CONCURRENT_SESSIONS30Maximum number of browser sessions at once
DEFAULT_SESSION_TIMEOUT1800000Default session timeout in ms (30 minutes)
MAX_SESSION_TIMEOUT86400000Maximum allowed session timeout in ms (24 hours)
CHROME_PATH(auto-detect)Path to Chrome/Chromium binary
STEALTH_DEFAULTfullDefault stealth level: none, basic, or full
PROXY_URL(empty)Global proxy URL (HTTP or SOCKS5)
CAPTCHA_API_KEY(empty)2captcha API key for CAPTCHA solving
CAPTCHA_PROVIDER2captchaCAPTCHA provider (2captcha or anticaptcha)
CDP_EXTERNAL_HOSTlocalhostHostname for client-facing CDP WebSocket URLs
CDP_EXTERNAL_PORT3000Port for client-facing CDP WebSocket URLs
CDP_EXTERNAL_SCHEMEwsWebSocket scheme: ws or wss
STRIPE_SECRET_KEY(empty)Stripe secret key for metered billing
STRIPE_WEBHOOK_SECRET(empty)Stripe webhook signing secret
STRIPE_PRICE_ID(empty)Stripe Price ID for the subscription product
STRIPE_METER_EVENT_NAMEbrowser_hoursStripe metered billing event name
ANTHROPIC_API_KEY(empty)Anthropic API key for the Agent endpoint
OPENAI_API_KEY(empty)OpenAI API key for the Agent endpoint
DATA_DIR./dataDirectory for SQLite DB, profiles, temp files
LOG_LEVELinfoLog level: trace, debug, info, warn, error, fatal

Resource Requirements

ResourceMinimumRecommendedNotes
RAM per session150 MB300 MBDepends on page complexity
RAM total (10 sessions)2 GB4 GBPlus base OS and Node.js overhead
RAM total (30 sessions)6 GB12 GBFor production workloads
CPU2 cores4+ coresChrome is CPU-intensive for rendering
Disk2 GB10 GBProfiles, temp files, SQLite DB
shm_size512 MB2 GBChrome uses /dev/shm for rendering

Scaling

BrowseFleet runs as a single process managing multiple Chrome tabs. For higher concurrency:

Vertical scaling

Increase MAX_CONCURRENT_SESSIONS and add more RAM/CPU. A 64GB machine can comfortably run 100+ sessions.

Horizontal scaling

Run multiple BrowseFleet instances behind a load balancer. Each instance is stateless for quick actions. Sessions are pinned to their instance.

CDP WebSocket routing

If running multiple instances, route CDP WebSocket connections to the instance that owns the session. Use sticky sessions or encode the instance ID in the session ID.

Health Check

The GET /health endpoint returns HTTP 200 when the server is ready. The Docker image includes a built-in HEALTHCHECK that polls this endpoint every 30 seconds.

bash
curl http://localhost:3000/health
# { "status": "ok" }