Problem: Failed to start Chrome CDP on port 18800

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

Root cause

On Ubuntu and most Linux distros, apt install chromium installs a snap wrapper, not a real browser:

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

Snap's AppArmor confinement interferes with how Apus spawns and monitors the browser process.

Other common Linux launch failures:

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 ~/.apus/apus.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 must keep snap Chromium, configure Apus 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/.apus/browser/apus/user-data \
  about:blank &

Optionally auto-start it with a systemd user service:

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

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

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

Verify the browser works

These calls go to the Apus browser control service, not to the Chrome CDP port used above. Its port is derived from gateway.port (default 18791 = gateway port + 2), so adjust the number if you moved the Gateway port. jq only pretty-prints the response; drop the pipe if you do not have it installed.

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
APUS_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 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. Use the managed browser instead: apus browser --browser-profile apus start (or set browser.defaultProfile: "apus").
  2. Keep local Chrome running with at least one open tab, then retry with --browser-profile user.

Notes:

Related