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

# Self-Hosting

> Run Rusty Browser on your own infrastructure

## Overview

Rusty Browser is fully open source. You can run the entire stack on your own servers and keep control of the deployment. You are responsible for your own infrastructure costs and any third-party providers you configure, such as AI models, proxies, or remote compute.

The codebase ships as pre-built binaries. You do not need a Rust toolchain to run it.

## What's in the Repo

The repository is a Cargo workspace with five crates:

* **rusty-server**: the HTTP API your clients talk to. Manages the browser registry in Redis, spawns agents via Flux, and runs the AI instruct engine.
* **rusty-agent**: a single-browser gRPC node. One agent runs per browser. It launches Chromium directly via the WebDriver BiDi / CDP protocol through [rustenium](https://github.com/dashn9/rustenium), applies fingerprint and identity layering via [rustenium-identity](https://github.com/dashn9/rustenium-identity), and accepts commands from the server over TLS gRPC.
* **rusty-cli**: a terminal client for the HTTP API. See [CLI docs](/open-source/cli).
* **rusty-common**: shared types, Redis store, config, AI providers, and the Flux client.
* **rusty-proto**: shared gRPC proto definitions.

There is also **rusty-frontend**, a Next.js dashboard for managing sessions visually. See [Frontend docs](/open-source/frontend).

## Repositories

<CardGroup cols={2}>
  <Card title="rusty-browser" icon="github" href="https://github.com/dashn9/rusty-browser">
    Server, agent, CLI, and common libraries
  </Card>

  <Card title="rustenium" icon="github" href="https://github.com/dashn9/rustenium">
    Browser engine (Chromium driver)
  </Card>

  <Card title="rustenium-identity" icon="github" href="https://github.com/dashn9/rustenium-identity">
    Fingerprint and identity layer
  </Card>

  <Card title="serverless-flux" icon="github" href="https://github.com/dashn9/serverless-flux">
    Scaling infrastructure
  </Card>
</CardGroup>

***

## Easy Setup (Windows)

The interactive PowerShell setup script handles downloading binaries, walking through configuration, and generating ready-to-use launch scripts. It is best for local setups or anyone who wants to get running quickly.

**Prerequisites:** Node.js v18+ for the frontend, plus Redis running locally or available over the network.

### Run the setup script

```powershell theme={null}
powershell -Command "curl.exe -sSL https://raw.githubusercontent.com/dashn9/rusty-browser/main/setup.ps1 -o setup.ps1; & .\setup.ps1"
```

The script will:

* Download `rusty.exe`, `rusty-cli.exe`, `flux.exe`, and `flux-agent.exe` into `%LOCALAPPDATA%\RustyBrowser`
* Ask for your Redis URL, AI provider key and model, and optionally AWS/GCP credentials for remote agent scaling
* Generate `rusty.yaml`, `flux.yaml`, and launch scripts
* Optionally add everything to your `PATH`

<Tip>
  If your machine is not publicly reachable from the internet, such as when it is behind NAT, the script can help you configure a tunnel for the gRPC port.
</Tip>

### Start the stack

Once setup completes:

```powershell theme={null}
rusty-launch              # server only
rusty-launch -Frontend    # server + frontend dashboard
```

If Windows Terminal is installed, each component opens in its own tab. Otherwise they open in separate windows.

### Initialize

Run this once before spawning any browsers. It generates TLS certs, registers the agent function with Flux, and deploys the agent binary:

```powershell theme={null}
rusty-cli init
# or use the Initialize button in the frontend UI
```

***

## Manual Setup

For users who want full control over configuration. Works on Windows, Linux, and macOS.

### Step 1: Download the binaries

Download the latest release for your platform from the [GitHub releases page](https://github.com/dashn9/rusty-browser/releases). You'll need:

* `rusty` / `rusty.exe`: the server
* `rusty-agent` / `rusty-agent.exe`: the browser agent, spawned automatically per browser
* `rusty-cli` / `rusty-cli.exe`: the CLI, recommended for setup and testing

### Step 2: Start Redis

<CodeGroup>
  ```powershell Windows theme={null}
  winget install Redis.Redis
  redis-server
  ```

  ```bash Linux theme={null}
  sudo apt install redis-server
  sudo systemctl start redis
  ```

  ```bash macOS theme={null}
  brew install redis
  brew services start redis
  ```
</CodeGroup>

### Step 3: Configure the server

Copy the example config and open it in an editor:

<CodeGroup>
  ```powershell Windows theme={null}
  Copy-Item example.rusty.yaml rusty.yaml
  ```

  ```bash Linux / macOS theme={null}
  cp example.rusty.yaml rusty.yaml
  ```
</CodeGroup>

For local mode without a separate Flux server, set `flux.local_binary` to point at the agent binary:

<CodeGroup>
  ```yaml Windows theme={null}
  flux:
    local_binary: ".\rusty-agent.exe"
  ```

  ```yaml Linux / macOS theme={null}
  flux:
    local_binary: "./rusty-agent"
  ```
</CodeGroup>

For production with Flux running separately, point to it instead:

```yaml theme={null}
flux:
  base_url: "http://127.0.0.1:7227"
  api_key: "your-flux-api-key"
  function_name: "rusty-agent"
```

### Step 4: Start the server

<CodeGroup>
  ```powershell Windows theme={null}
  $env:RUSTY_CONFIG = "rusty.yaml"
  .\rusty.exe
  ```

  ```bash Linux / macOS theme={null}
  RUSTY_CONFIG=rusty.yaml ./rusty
  ```
</CodeGroup>

### Step 5: Initialize

<CodeGroup>
  ```powershell Windows theme={null}
  .\rusty-cli.exe init
  ```

  ```bash Linux / macOS theme={null}
  ./rusty-cli init
  ```
</CodeGroup>

### Step 6: Configure the CLI

<CodeGroup>
  ```powershell Windows theme={null}
  .\rusty-cli.exe env set url http://127.0.0.1:8080
  ```

  ```bash Linux / macOS theme={null}
  ./rusty-cli env set url http://127.0.0.1:8080
  ```
</CodeGroup>

If your server config enables `X-API-Key`, also set the CLI key:

<CodeGroup>
  ```powershell Windows theme={null}
  .\rusty-cli.exe env set api-key your-local-key
  ```

  ```bash Linux / macOS theme={null}
  ./rusty-cli env set api-key your-local-key
  ```
</CodeGroup>

### Step 7: Verify

<CodeGroup>
  ```powershell Windows theme={null}
  .\rusty-cli.exe browser spawn
  .\rusty-cli.exe browser navigate https://example.com
  .\rusty-cli.exe browser screenshot
  .\rusty-cli.exe browser close-all
  ```

  ```bash Linux / macOS theme={null}
  ./rusty-cli browser spawn
  ./rusty-cli browser navigate https://example.com
  ./rusty-cli browser screenshot
  ./rusty-cli browser close-all
  ```
</CodeGroup>

***

## Setting Up Flux (Production Scaling)

Flux is the control plane that `rusty-server` uses to spawn browser agents. In local mode it runs agents as subprocesses on the same machine. In production mode it provisions and autoscales agent nodes across AWS EC2 or GCP Compute Engine when those providers are configured.

The easy setup script configures Flux automatically. If you're doing a manual setup or want to run Flux separately, here's how.

### Docker (GHCR)

```bash theme={null}
docker run -p 7227:7227 \
  -v /path/to/flux.yaml:/etc/flux/flux.yaml \
  ghcr.io/dashn9/serverless-flux:latest
```

### Windows binary

Download `flux.exe` from the [serverless-flux releases page](https://github.com/dashn9/serverless-flux/releases), create a `flux.yaml` from the [example config](https://github.com/dashn9/serverless-flux/blob/main/example.flux.yaml), and run it:

```powershell theme={null}
.\flux.exe
```

At minimum your `flux.yaml` needs:

```yaml theme={null}
api_key: your-flux-api-key
redis_addr: localhost:6379
```

Add an `aws` or `gcp` provider block to enable remote node provisioning and autoscaling. Flux handles SSH bootstrapping of agents, TLS cert generation, and scale-up/scale-down automatically.

For full configuration options and the serverless agent worker setup, see the [serverless-flux GitHub page](https://github.com/dashn9/serverless-flux).
