#Wrong browser use

1 messages · Page 1 of 1 (latest)

drowsy breach
#

Why my agent always expect to use host browser instead of the browser I installed in the docker, the agent is in the docker , it can’t use my host browsers

spiral socketBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

drowsy breach
#

How to tell it to use the browser in container

#

Any ideas

#

Do I need to configure which browser it can use ?

fluid ginkgoBOT
#

Usually no — OpenClaw will auto-pick a Chromium-based browser (Chrome → Brave → Edge → Chromium) for the agent-controlled browser.

But it depends what you mean by “which browser”:

  1. Your Dashboard / Control UI (the web UI you open yourself)
  • That’s just a website — use whatever (Chrome/Firefox/Safari). No config needed.
  1. The agent “browser tool” (automation: open tabs/click/type)
    You have two modes:
  • Managed, isolated browser (openclaw profile): no extension needed.
    If you want this by default, set:
    openclaw config set browser.defaultProfile openclaw
    
    Docs: https://docs.openclaw.ai/tools/browser
#

If it’s picking the “wrong” Chromium browser (e.g. you want Brave specifically), you can force it with:

openclaw config set browser.executablePath "/path/to/brave-or-chrome"

If you tell me what “wrong browser” you’re seeing (and your OS), I can point you at the right setting/mode.

drowsy breach
#

Browser (OpenClaw-managed

#

The agent said Reasoning:
The user wants to use Chromium (profile openclaw? they said "Use chromium"). The browser tool is failing because no tab attached. We need to instruct user to attach the Chrome extension relay. According to guidelines: If Chrome extension relay not attached, ask them to attach it. So we should respond asking them to click the OpenClaw Browser Relay toolbar icon on a tab to attach. Provide instructions.

fluid ginkgoBOT
#

Yep — that message usually means you’re using the chrome profile (extension relay), and no tab is attached yet.

You’ve got two options:

Option A (recommended): use the managed “openclaw” browser (no extension)

This launches a dedicated, isolated Chromium profile that the agent can control.

openclaw config set browser.defaultProfile openclaw
openclaw browser --browser-profile openclaw start

Docs: https://docs.openclaw.ai/tools/browser

Option B: control your existing Chromium/Chrome tab (requires extension + attach)

If you want it to drive your current Chromium browser, you must:

#
  1. Install/load the OpenClaw Browser Relay extension
openclaw browser extension install
openclaw browser extension path

Then in Chromium: chrome://extensions → enable Developer mode → Load unpacked → pick that printed folder.

  1. Open the page you want to automate, then click the “OpenClaw Browser Relay” toolbar icon on that tab
    You should see the badge flip to ON (that’s the “attached” state).

  2. Now the agent/tool can use:

  • profile="chrome" (or CLI: openclaw browser --browser-profile chrome tabs)

Docs: https://docs.openclaw.ai/tools/chrome-extension

If you tell me your OS (macOS/Windows/Linux) and whether you want isolated automation (Option A) or drive your existing tab (Option B), I can give the exact quickest setup.

drowsy breach
#

I choose option a, but how to configure it

fluid ginkgoBOT
#

I’m guessing “option eight” = Option A (the managed openclaw browser, no extension). If that’s what you meant, configure it like this:

1) Set the default profile to the managed browser

openclaw config set browser.defaultProfile openclaw

2) Point OpenClaw at Chromium explicitly (optional but recommended)

You need the path to the Chromium executable.

Linux

which chromium || which chromium-browser

Then set it, e.g.

#
openclaw config set browser.executablePath "/usr/bin/chromium"

macOS

Chromium is usually:

openclaw config set browser.executablePath "/Applications/Chromium.app/Contents/MacOS/Chromium"

Windows

It’s usually something like:

openclaw config set browser.executablePath "C:\\Program Files\\Chromium\\Application\\chrome.exe"

3) Restart the gateway

#
openclaw gateway restart

4) Test

openclaw browser --browser-profile openclaw status
openclaw browser --browser-profile openclaw start
openclaw browser --browser-profile openclaw open https://example.com

Docs: https://docs.openclaw.ai/tools/browser

If you tell me your OS + what which chromium (or equivalent) returns, I’ll give you the exact one-liner for the browser.executablePath. Also: confirm you meant Option A (managed browser) and not the extension relay option.

drowsy breach
#

I use Mac OS

fluid ginkgoBOT
#

On macOS, to use the managed openclaw browser profile (Option A) you mainly set:

  • browser.defaultProfile = "openclaw"
  • (optionally) browser.executablePath to the exact Chromium app you want

1) Set the managed browser as default

openclaw config set browser.defaultProfile openclaw

2) If you specifically want Chromium (not Chrome/Brave), set executablePath

First, check if Chromium is actually installed:

ls -d "/Applications/Chromium.app" "$HOME/Applications/Chromium.app" 2>/dev/null
#

If it exists, set:

openclaw config set browser.executablePath "/Applications/Chromium.app/Contents/MacOS/Chromium"

(If it’s in ~/Applications, use that path instead.)

Note: many Macs don’t have “Chromium.app” installed by default. If you don’t have it, easiest is to just use Chrome/Brave/Edge (OpenClaw auto-detects those), and skip executablePath.

3) Restart the gateway

openclaw gateway restart

4) Quick test

#
openclaw browser --browser-profile openclaw status
openclaw browser --browser-profile openclaw start
openclaw browser --browser-profile openclaw open https://example.com

Docs: https://docs.openclaw.ai/tools/browser

If you paste the output of:

ls -d "/Applications/Chromium.app" "/Applications/Google Chrome.app" "/Applications/Brave Browser.app" 2>/dev/null

I’ll tell you the exact best browser.executablePath for what you have installed.

drowsy breach
#

My agent is in docker

#

The browser also

#

With headless mode on

fluid ginkgoBOT
#

Headless is just a config flag for the managed openclaw browser.

Enable headless mode

openclaw config set browser.defaultProfile openclaw
openclaw config set browser.headless true
openclaw gateway restart

Test it

openclaw browser --browser-profile openclaw status
openclaw browser --browser-profile openclaw start
openclaw browser --browser-profile openclaw open https://example.com

In headless, you won’t see a browser window. To verify what it’s doing, use screenshots/snapshots:

#
openclaw browser --browser-profile openclaw screenshot --full-page
openclaw browser --browser-profile openclaw snapshot --interactive

Docs: https://docs.openclaw.ai/tools/browser

If you paste the output of openclaw browser --browser-profile openclaw status, I can tell if it’s actually launching headless (and if it’s picking the browser you expect).

drowsy breach
#

I want to edit the json config directly, tell me where to add the default configuration

drowsy breach
#

~/.openclaw/openclaw.json

fluid ginkgoBOT
#

Yep — ~/.openclaw/openclaw.json is the main config file (it’s JSON5, so comments/trailing commas are OK).

For managed browser (openclaw profile) + headless on macOS, a minimal working snippet looks like:

{
  browser: {
    enabled: true,
    defaultProfile: "openclaw",
    headless: true,

    // Optional: force a specific browser binary (only if you want Chromium specifically)
    // executablePath: "/Applications/Chromium.app/Contents/MacOS/Chromium",
  },
}
#

After editing, restart:

openclaw gateway restart

And test:

openclaw browser --browser-profile openclaw start
openclaw browser --browser-profile openclaw open https://example.com
openclaw browser --browser-profile openclaw screenshot --full-page

If you paste your current browser: { ... } block (just that part), I’ll sanity-check it for typos/format issues.

drowsy breach
#

Give me minimum config

fluid ginkgoBOT
#

Put this in ~/.openclaw/openclaw.json (JSON5):

{
  browser: {
    enabled: true,
    defaultProfile: "openclaw",
    headless: true,
  },
}

Then:

openclaw gateway restart
drowsy breach
#

If I want claw in containers control my host machine browser. How to configure this json file

fluid ginkgoBOT
#

A containerized Gateway can’t “reach out” and drive your macOS GUI browser by itself. The supported way is:

Gateway (in Docker) runs the agent → a node host running on your Mac provides the browser → Gateway proxies browser tool calls to that node.

1) Gateway/container ~/.openclaw/openclaw.json

You usually don’t need much here. Optionally pin which node should be used for browser routing:

{
  gateway: {
    nodes: {
      browser: {
        mode: "auto", // default behavior: route to a browser-capable node if present
        // node: "My Mac", // optional: pin a specific node name/id once it’s paired
      },
    },
#
  },
}

(Leave browser.enabled alone on the gateway unless you have a reason; node proxy routing is the key.)

2) On your Mac: run a node host + enable browser there

On the Mac’s ~/.openclaw/openclaw.json, make sure browser is enabled and pick what kind of “host browser” you mean:

A) Managed browser on the Mac (can be headless)

{
  browser: {
    enabled: true,
    defaultProfile: "openclaw",
#
    headless: true,
  },
}

B) Control your existing Chrome tab on the Mac (extension relay)

{
  browser: {
    enabled: true,
    defaultProfile: "chrome",
  },
}

Then you must install the extension on the Mac and click it to attach to a tab (badge ON):

#

3) Start the node host on the Mac and pair it

Run on the Mac (needs the gateway token in OPENCLAW_GATEWAY_TOKEN):

export OPENCLAW_GATEWAY_TOKEN="
"
openclaw node run --host 127.0.0.1 --port 18789 --display-name "Mac Browser Node"

Approve the pairing on the Gateway:

openclaw devices list
openclaw devices approve <requestId>

Docs for node host: https://docs.openclaw.ai/cli/node
Browser proxy note: https://docs.openclaw.ai/tools/browser (see “Node browser proxy”)

#

If you tell me which “host browser” you want (A headless managed, or B your existing Chrome tab), I can give you the exact minimal two config blocks + the exact commands for your Docker setup (sometimes the host/port is 127.0.0.1, sometimes you use a different published port).

fluid ginkgoBOT
#

“Here” as in ~/.openclaw/openclaw.json depends on which machine you’re talking about — you effectively have two configs:

1) In the container (Gateway): you generally don’t configure a browser

The container can’t drive your macOS GUI browser directly. It just needs to be able to route browser tool calls to a node.

You can leave this empty, or optionally pin a node later:

{
  gateway: {
    nodes: {
      browser: {
        mode: "auto",
        // node: "Mac Browser Node", // optional pin
      },
    },
#

That 1006 is almost always “you spoke the wrong protocol or hit the wrong endpoint”.

In the default Docker setup, the Gateway does NOT serve TLS, so the WebSocket URL is:

  • inside docker compose network: ws://openclaw-gateway:18789
  • from your Mac (published port): ws://127.0.0.1:18789


but you’re using:

  • wss://openclaw-gateway:18789 ← this tries TLS, and the gateway isn’t speaking TLS there → connection drops → 1006.

Fix

Use ws://, not wss://:

docker compose run --rm openclaw-cli status --url ws://openclaw-gateway:18789
#
  },
}

2) On your Mac (Node host): this is where the browser config goes

Edit your Mac’s ~/.openclaw/openclaw.json and set the managed browser headless:

{
  browser: {
    enabled: true,
    defaultProfile: "openclaw",
    headless: true,
  },
}
#

If you’re running the command on your Mac (not inside the container), use:

openclaw status --url ws://127.0.0.1:18789

Two quick sanity checks

  1. Make sure the port is actually published to your Mac (compose should have something like):
ports:
  - "18789:18789"
  1. If you pass --url, also pass auth explicitly (or set env), e.g.:
export OPENCLAW_GATEWAY_TOKEN="
"
#

Then run a node host on the Mac so the containerized Gateway can proxy browser actions to it.

One key question

When you say “Gateway in containers”, did you publish the gateway port to your Mac, e.g. 18789:18789 in docker compose?

  • If yes, your Mac node host connects to: --host 127.0.0.1 --port 18789
  • If no, tell me what your compose ports look like (or paste the ports: section) and I’ll tell you the right --host/--port (sometimes it’s a different published port).

Also: are you trying to control (A) the managed headless browser, or (B) your existing Chrome tab via the extension?

#
openclaw status --url ws://127.0.0.1:18789

If you paste the exact command you ran (and whether it was on the Mac or via docker compose run openclaw-cli), I’ll give you the exact working one-liner.