#!/usr/bin/env bash # browser-use on an exe.dev VM: AI browser agents in a Chrome you can watch. # # curl -fsSL https://exe.dev/deploy/browser-use/setup.sh | bash # # 1. The desktop from https://exe.dev/deploy/linux-desktop (Xfce, Chrome, # KasmVNC on port 8444), unless it is already there. # 2. browser-use, pinned, in a uv project in ~/browser-agent, with agent.py # (run one task) and server.py (MCP and HTTP on port 8080). # browser-use's telemetry is turned off. # 3. The browser-agent systemd service for server.py, and a desktop launcher # that opens the agent's browser profile so you can sign in to sites. # # Safe to run again; it keeps profiles and runs. From https://exe.dev/deploy/browser-use set -euo pipefail BROWSER_USE_VERSION="${BROWSER_USE_VERSION:-1.0.6}" FILES="${FILES:-https://exe.dev/deploy/browser-use}" PORT=8080 H="$HOME" DIR="$H/browser-agent" if [ "$(id -u)" = 0 ]; then echo "Run this as your user (exedev), not root." >&2; exit 1; fi echo "== desktop" if [ -f /etc/systemd/system/desktop.service ]; then echo "already set up" else curl -fsSL https://exe.dev/deploy/linux-desktop/setup.sh | bash fi echo "== browser-use $BROWSER_USE_VERSION" mkdir -p "$DIR/profiles" "$DIR/runs" cd "$DIR" [ -f pyproject.toml ] || uv init --bare --python 3.12 --name browser-agent --quiet . uv add --quiet "browser-use==$BROWSER_USE_VERSION" curl -fsSLO "$FILES/agent.py" curl -fsSLO "$FILES/server.py" # browser-use's anonymous telemetry includes the URLs the agent visits and its # final answers; off here, since the agent may be signed in to your accounts. # `.venv/bin/browser-use telemetry enable` turns it back on. .venv/bin/browser-use telemetry disable >/dev/null echo "== launcher" mkdir -p "$H/Desktop" "$H/.local/share/applications" cat > "$H/.local/share/applications/agent-chrome.desktop" </dev/null </dev/null && break sleep 1 done systemctl is-active browser-agent echo "API: HTTP $(curl -s -o /dev/null -w '%{http_code}' "localhost:$PORT/runs")" echo "Desktop: https://$(hostname).exe.xyz:8444/" echo "API and MCP: https://$(hostname).exe.xyz:$PORT/"