Fix Chrome CDP startup issues on Linux for OpenClaw
This page helps you resolve Chrome, Brave, Edge, or Chromium CDP startup failures on Linux when using OpenClaw browser control. It covers snap confinement, stale lock files, and missing display errors.
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 a real browser:
Note, selecting 'chromium-browser' instead of 'chromium'
chromium-browser is already the newest version (2:1snap1-0ubuntu2).
Snap's AppArmor confinement blocks OpenClaw from spawning and monitoring the browser process properly.
Other common reasons Linux launches fail:
The profile appears to be in use by another Chromium process: staleSingleton*lock files inside the managed profile directory. OpenClaw removes those locks and retries once when the lock points to a dead process or one on a different host.Missing X server or $DISPLAY: a visible browser was explicitly requested on a machine without a desktop session. Local managed profiles fall back to headless mode on Linux when bothDISPLAYandWAYLAND_DISPLAYare unset. If you setOPENCLAW_BROWSER_HEADLESS=0,browser.headless: false, orbrowser.profiles.<name>.headless: false, remove that headed override, setOPENCLAW_BROWSER_HEADLESS=1, startXvfb, runopenclaw browser start --headlessfor a one-shot 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, configure OpenClaw to attach to a manually started browser instead of launching it:
{
"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 auto-start it 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
| Option | Description | Default |
|---|---|---|
browser.enabled | Enable browser control | true |
browser.executablePath | Path to a Chromium-based browser binary (Chrome/Brave/Edge/Chromium) | auto-detected (prefers the OS default browser when Chromium-based) |
browser.headless | Run without GUI | false |
OPENCLAW_BROWSER_HEADLESS | Per-process override for local managed browser headless mode | unset |
browser.noSandbox | Add --no-sandbox flag (needed for some Linux setups) | false |
browser.attachOnly | Do not launch a browser; only attach to an existing one | false |
On 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 allows.
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:
- Use the managed browser instead:
openclaw browser --browser-profile openclaw start(or setbrowser.defaultProfile: "openclaw"). - Keep local Chrome running with at least one open tab, then retry with
--browser-profile user.
Notes:
useris host-only. On Linux servers, containers, or remote hosts, prefer CDP profiles instead.userand otherexisting-sessionprofiles share the current Chrome MCP limits: ref-driven actions only, one file per upload, no dialogtimeoutMsoverrides, nowait --load networkidle, and noresponsebody, PDF export, download interception, or batch actions.- Local
openclaw-driver profiles auto-assigncdpPort/cdpUrl; only set those manually for remote CDP. - Remote CDP profiles accept
http://,https://,ws://, andwss://. Use HTTP(S) for/json/versiondiscovery, or WS(S) when your browser service gives you a direct DevTools socket URL.