Fix Chrome CDP Startup Issues on Linux for OpenClaw

Troubleshoot Chrome, Brave, Edge, or Chromium CDP startup failures on Linux. Covers Snap AppArmor conflicts, profile lock errors, and missing X server issues.

Problem: Failed to start Chrome CDP on port 18800

{ "error": "Error: Failed to start Chrome CDP on port 18800 for profile \"openclaw\"." }

Root cause

On Ubuntu and most Linux distributions, apt install chromium installs a snap wrapper rather than an actual browser:

Note, selecting 'chromium-browser' instead of 'chromium'
chromium-browser is already the newest version (2:1snap1-0ubuntu2).

The AppArmor confinement applied by Snap interferes with how OpenClaw launches and tracks the browser process.

Other typical reasons for launch failure on Linux:

  • The profile appears to be in use by another Chromium process: outdated Singleton* lock files inside the managed profile directory. OpenClaw clears those locks and makes one more attempt when the lock references a dead process or one running on a different machine.
  • Missing X server or $DISPLAY: a visible browser was explicitly required on a machine that has no desktop session. On Linux, local managed profiles automatically switch to headless mode when both DISPLAY and WAYLAND_DISPLAY are not set. If you have set OPENCLAW_BROWSER_HEADLESS=0, browser.headless: false, or browser.profiles.<name>.headless: false, remove that headed override, configure OPENCLAW_BROWSER_HEADLESS=1, start Xvfb, run openclaw browser start --headless for a single managed launch, or run OpenClaw inside a real desktop session.

Solution 1: install Google Chrome (recommended)

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt --fix-broken install -y  # if there are dependency errors

Update ~/.openclaw/openclaw.json:

{
  "browser": {
    "enabled": true,
    "executablePath": "/usr/bin/google-chrome-stable",
    "headless": true,
    "noSandbox": true
  }
}

Solution 2: use snap Chromium in attach-only mode

If you need to keep snap Chromium, tell OpenClaw to connect to a browser you start by hand instead of launching one itself:

{
  "browser": {
    "enabled": true,
    "attachOnly": true,
    "headless": true,
    "noSandbox": true
  }
}

Start Chromium manually:

chromium-browser --headless --no-sandbox --disable-gpu \
  --remote-debugging-port=18800 \
  --user-data-dir=$HOME/.openclaw/browser/openclaw/user-data \
  about:blank &

Optionally configure it to start automatically with a systemd user service:

# ~/.config/systemd/user/openclaw-browser.service
[Unit]
Description=OpenClaw Browser (Chrome CDP)
After=network.target

[Service]
ExecStart=/snap/bin/chromium --headless --no-sandbox --disable-gpu --remote-debugging-port=18800 --user-data-dir=%h/.openclaw/browser/openclaw/user-data about:blank
Restart=on-failure
RestartSec=5

[Install]
WantedBy=default.target
systemctl --user enable --now openclaw-browser.service

Verify the browser works

curl -s http://127.0.0.1:18791/ | jq '{running, pid, chosenBrowser}'
curl -s -X POST http://127.0.0.1:18791/start
curl -s http://127.0.0.1:18791/tabs

Config reference

OptionDescriptionDefault
browser.enabledEnable browser controltrue
browser.executablePathPath to a Chromium-based browser binary (Chrome/Brave/Edge/Chromium)auto-detected (prefers the OS default browser when Chromium-based)
browser.headlessRun without GUIfalse
OPENCLAW_BROWSER_HEADLESSPer-process override for local managed browser headless modeunset
browser.noSandboxAdd --no-sandbox flag (needed for some Linux setups)false
browser.attachOnlyDo not launch a browser; only attach to an existing onefalse

On a Raspberry Pi, older VPS hosts, or slow storage, use a manually launched browser with attachOnly when Chrome needs more time to expose its CDP HTTP endpoint or become ready than the managed-browser deadline permits.

Problem: No Chrome tabs found for profile="user"

You are using the user (existing-session / Chrome MCP) profile and no tabs are open to attach to.

Fix options:

  1. Switch to the managed browser: openclaw browser --browser-profile openclaw start (or set browser.defaultProfile: "openclaw").
  2. Keep a local Chrome instance running with at least one open tab, then retry using --browser-profile user.

Notes:

  • user works only on the local host. On Linux servers, containers, or remote hosts, use CDP profiles instead.
  • user and other existing-session profiles share the current Chrome MCP limits: ref-driven actions only, one file per upload, no dialog timeoutMs overrides, no wait --load networkidle, and no responsebody, PDF export, download interception, or batch actions.
  • Local openclaw-driver profiles automatically assign cdpPort/cdpUrl; set those manually only for remote CDP.
  • Remote CDP profiles accept http://, https://, ws://, and wss://. Use HTTP(S) for /json/version discovery, or WS(S) when your browser service provides a direct DevTools socket URL.
680 words · updated Jul 27, 2026