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

# Installation

> Every way to install webrain — one-liners, package managers, from source.

# Installation

Pick a path. All of them give you the `webrain` binary; the first run of
`webrain install` downloads the browser engine.

## Global installation (recommended)

<CodeGroup>
  ```bash Linux / macOS theme={null}
  curl -fsSL https://raw.githubusercontent.com/prokopis3/webrain/main/scripts/install.sh | bash
  ```

  ```powershell Windows theme={null}
  irm https://raw.githubusercontent.com/prokopis3/webrain/main/scripts/install.ps1 | iex
  ```
</CodeGroup>

Then, in any terminal:

```bash theme={null}
webrain install          # Download Chrome for Testing (first time only)
webrain mcp --http 9223  # start the MCP server
```

### Manual download

<CodeGroup>
  ```powershell Windows theme={null}
  $dir = "$env:LOCALAPPDATA\Programs\webrain"
  New-Item -ItemType Directory -Force -Path $dir | Out-Null
  Invoke-WebRequest "https://github.com/prokopis3/webrain/releases/latest/download/webrain-windows.exe" -OutFile "$dir\webrain.exe"
  [Environment]::SetEnvironmentVariable("Path", "$([Environment]::GetEnvironmentVariable('Path','User'));$dir", "User")
  # open a new terminal, then:
  webrain install
  webrain mcp --http 9223
  ```

  ```bash Linux / macOS theme={null}
  curl -L -o ~/.local/bin/webrain https://github.com/prokopis3/webrain/releases/latest/download/webrain-linux
  chmod +x ~/.local/bin/webrain
  webrain install
  webrain mcp --http 9223
  ```
</CodeGroup>

<Note>
  macOS: swap `webrain-linux` for `webrain-macos` in the curl line.
</Note>

## Package managers

<CodeGroup>
  ```bash Homebrew (macOS) theme={null}
  brew tap prokopis3/webrain
  brew install webrain
  webrain install
  ```

  ```powershell Scoop (Windows) theme={null}
  scoop bucket add webrain https://github.com/prokopis3/scoop-webrain
  scoop install webrain
  webrain install
  ```

  ```bash Cargo (Rust) theme={null}
  cargo install --git https://github.com/prokopis3/webrain webrain-cli
  webrain install
  ```
</CodeGroup>

## From source

```bash theme={null}
git clone https://github.com/prokopis3/webrain
cd webrain
cargo build --release --bin webrain
./target/release/webrain install   # Download Chrome (first time only)
./target/release/webrain mcp --http 9223
```

## Linux dependencies

Chrome needs system libraries on Linux. Install them before first run:

<CodeGroup>
  ```bash Debian / Ubuntu theme={null}
  sudo apt-get install -y libnss3 libnspr4 libxkbcommon0 libatk1.0-0 \
    libatk-bridge2.0-0 libxcomposite1 libxdamage1 libxrandr2 libxfixes3 \
    libxcursor1 libxi6 libxtst6 libxss1 libxext6 fonts-liberation
  ```

  ```bash Fedora theme={null}
  sudo dnf install -y nss nspr libxkbcommon atk at-spi2-atk at-spi2-core \
    libXcomposite libXdamage libXrandr libXfixes libXcursor libXi libXtst \
    libXScrnSaver libXext
  ```
</CodeGroup>

If you see *"shared library"* errors when running Chrome, that's the
missing-deps symptom — install the list above.

## Updating

```bash theme={null}
webrain upgrade
```

Detects your install method (Homebrew, Scoop, or manual) and updates
automatically. For a cargo install:

```bash theme={null}
cargo install --git https://github.com/prokopis3/webrain webrain-cli --force
```

Re-download engines after an update (the cache dir stays; versions are
additive):

```bash theme={null}
webrain install
webrain install --engine obscura
```

## OS compatibility

| Engine                                           | Windows                            | macOS              | Linux             |
| ------------------------------------------------ | ---------------------------------- | ------------------ | ----------------- |
| Chrome for Testing (`webrain install`)           | ✅                                  | ✅                  | ✅                 |
| Obscura (`webrain install --engine obscura`)     | ✅ x86\_64                          | ✅ x86\_64 / arm64  | ✅ x86\_64 / arm64 |
| Lightpanda (`webrain lightpanda`, binary needed) | ⚠️ (needs a Windows build on PATH) | ✅                  | ✅                 |
| Docker (`docker/Dockerfile`)                     | via Docker Desktop                 | via Docker Desktop | ✅                 |

Binary discovery is automatic on every OS: env override → PATH → `~/.lightpanda`,
`~/.obscura`, `~/.local/bin` → the webrain engine cache.
