Claw Mart
← Back to Blog
March 20, 20269 min readClaw Mart Team

OpenClaw Not Starting? Common Installation Fixes

OpenClaw Not Starting? Common Installation Fixes

OpenClaw Not Starting? Common Installation Fixes

Look, I've been there. You download OpenClaw, you follow the README, you get it running in a terminal, you feel like a genius for about thirty seconds — and then you try to actually use it inside an agent framework and everything falls apart. The claw doesn't start. Or it starts and immediately dies. Or it hangs indefinitely on the first tool call while your agent sits there like it's contemplating the meaning of life.

You're not alone. This is probably the single most common issue people hit with OpenClaw, and it's frustrating because the tool itself is genuinely powerful. The problem isn't that OpenClaw is broken. The problem is that computer-control tools were originally designed as standalone demos, and plugging them into real agent workflows exposes a whole category of architectural mismatches that nobody warned you about.

Let's fix it.

The Core Problem: Why OpenClaw Refuses to Start

Before diving into fixes, it helps to understand why this happens so consistently. OpenClaw runs as a separate process — typically a local server that listens on a WebSocket or HTTP port. It captures your screen, processes visual input, and executes mouse/keyboard actions. That's a lot of moving parts, and every single one of them can fail silently.

When you run openclaw start in your terminal, everything works because:

  • Your terminal has the right environment variables
  • Your user session has the right OS permissions
  • Nothing else is fighting for the same port
  • The process starts synchronously, so it's ready before you interact with it

When an agent framework tries to launch OpenClaw, none of those assumptions hold. The framework might be running in a virtualenv, a Docker container, an async event loop, or a sandboxed IDE environment. It spawns OpenClaw as a child process, and suddenly the permissions don't propagate, the ports collide, or the agent tries to call the claw before it's actually listening.

That's the root cause. Now let's systematically knock out every variant of this problem.

Fix #1: Process Spawning and Server Startup Failures

Symptoms: "Failed to start claw," "Connection refused to localhost:8765," or the agent just hangs forever on the first tool call.

This is the most common issue, and it's almost always a race condition. Your agent framework fires up OpenClaw as a subprocess and immediately tries to send it a command. But OpenClaw needs a few seconds to initialize its screen capture, set up the input controller, and start listening on its port. The agent doesn't wait. Connection refused. Everything breaks.

The fix: Don't let your agent framework start OpenClaw on demand. Start it separately and connect to it as a running service.

First, start OpenClaw in its own terminal:

export OPENCLAW_PORT=8765
openclaw start --verbose

Wait until you see something like:

[INFO] OpenClaw controller listening on ws://localhost:8765
[INFO] Screen capture initialized (1920x1080)
[INFO] Ready for connections.

Then, in your agent code, connect to it as a remote tool rather than trying to spawn it:

from openclaw.client import ClawClient

# Connect to already-running instance
claw = ClawClient(host="localhost", port=8765)

# Verify it's actually ready before proceeding
if not claw.ping():
    raise RuntimeError("OpenClaw is not running. Start it with: openclaw start --verbose")

If you absolutely must start it programmatically (say, in a CI/CD pipeline or automated setup), use a proper startup wrapper with a health check:

import subprocess
import time
import requests

def start_and_wait_for_claw(port=8765, timeout=30):
    """Start OpenClaw and wait until it's actually ready."""
    
    process = subprocess.Popen(
        ["openclaw", "start", "--port", str(port), "--verbose"],
        env={**os.environ, "OPENCLAW_PORT": str(port)},
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE
    )
    
    # Poll until the health endpoint responds
    start_time = time.time()
    while time.time() - start_time < timeout:
        try:
            resp = requests.get(f"http://localhost:{port}/health")
            if resp.status_code == 200:
                print(f"OpenClaw ready on port {port}")
                return process
        except requests.ConnectionError:
            time.sleep(0.5)
    
    process.kill()
    stdout, stderr = process.communicate()
    raise RuntimeError(
        f"OpenClaw failed to start within {timeout}s.\n"
        f"stdout: {stdout.decode()}\n"
        f"stderr: {stderr.decode()}"
    )

That timeout and health check loop is the key. Without it, you're gambling on timing, and you'll lose that bet about 60% of the time.

Fix #2: macOS Permission Nightmares

Symptoms: Works perfectly when you run it from Terminal. Fails silently or throws "Permission denied" when launched from VS Code, PyCharm, or an agent framework.

macOS is incredibly aggressive about input monitoring and accessibility permissions. When OpenClaw tries to simulate mouse clicks or keyboard input, macOS checks whether the parent process has Accessibility permissions. Not Python. Not OpenClaw. The thing that launched them.

This means you need to grant permissions to every possible parent in the chain:

  1. Open System Settings → Privacy & Security → Accessibility
  2. Click the + button and add:
    • /Applications/Utilities/Terminal.app (or whatever terminal you use)
    • /Applications/Visual Studio Code.app (if running from VS Code)
    • Your Python executable: run which python to find it, then navigate there in Finder
  3. Do the same for Privacy & Security → Input Monitoring
  4. Restart your terminal/IDE after adding permissions. This is the step everyone forgets. The permissions don't take effect until the app restarts.

If you're running inside a virtualenv, the Python executable path matters. It's not /usr/bin/python3 — it's something like /Users/you/.venvs/myproject/bin/python3. Add that specific executable.

You can verify permissions are working with a quick test:

import pyautogui

# If this throws a permission error, your macOS permissions aren't set up
pyautogui.moveTo(100, 100)
print("Permissions OK")

Run that from the same environment your agent will use. If it works there, it'll work in OpenClaw.

Fix #3: Port Conflicts

Symptoms: "Address already in use," "OSError: [Errno 98] Address already in use," or OpenClaw starts but the agent connects to the wrong thing.

Agent frameworks are port-hungry. LangSmith tracing, vector database servers, API proxies, monitoring dashboards — they all grab ports. If OpenClaw's default port (often 8765 or 9222) collides with something else, you get a silent failure or a confusing connection to the wrong service.

The fix: Always set an explicit, non-default port and check for conflicts before starting:

# Check if anything is already using port 8765
lsof -i :8765

# If something is, either kill it or use a different port
export OPENCLAW_PORT=8800
openclaw start --port 8800 --verbose

In your agent configuration, make sure the port matches:

import os

CLAW_PORT = int(os.environ.get("OPENCLAW_PORT", 8800))

claw = ClawClient(host="localhost", port=CLAW_PORT)

Pro tip: If you're running multiple OpenClaw instances (say, for parallel agent testing), assign each one a unique port and pass it through as a parameter. Don't rely on defaults.

Fix #4: Docker-Specific Issues

Symptoms: Everything works locally but fails in Docker. "Claw process died with exit code 1." No display found. Screen capture returns black frames.

Docker containers don't have a display server by default. OpenClaw needs to capture a screen, and inside a vanilla container, there's no screen to capture. You need a virtual display.

Here's a working docker-compose.yml setup:

version: '3.8'
services:
  openclaw:
    image: openclaw/controller:latest
    environment:
      - DISPLAY=:99
      - OPENCLAW_PORT=8765
    ports:
      - "8765:8765"
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
    command: >
      bash -c "Xvfb :99 -screen 0 1920x1080x24 &
               sleep 2 &&
               openclaw start --port 8765 --verbose"
    
  agent:
    build: ./agent
    environment:
      - OPENCLAW_HOST=openclaw
      - OPENCLAW_PORT=8765
    depends_on:
      - openclaw

Key things to notice:

  • Xvfb creates a virtual framebuffer so OpenClaw has a "screen" to capture
  • The sleep 2 gives Xvfb time to initialize before OpenClaw starts (there's that race condition again)
  • The agent service connects to openclaw (the Docker service name) rather than localhost
  • depends_on ensures the claw container starts first, but remember — depends_on doesn't wait for the service to be ready, just for the container to start. Your agent still needs that health check loop from Fix #1.

If you need to interact with a real browser inside Docker, add a VNC server so you can actually see what's happening:

  openclaw:
    # ... previous config ...
    ports:
      - "8765:8765"
      - "5900:5900"  # VNC port for debugging
    command: >
      bash -c "Xvfb :99 -screen 0 1920x1080x24 &
               x11vnc -display :99 -forever -nopw &
               sleep 2 &&
               openclaw start --port 8765 --verbose"

Connect with any VNC viewer to localhost:5900 and you can watch your agent work in real time. Incredibly useful for debugging.

Fix #5: Dependency Conflicts

Symptoms: Import errors, pydantic validation errors, AttributeError on modules you know should work.

OpenClaw depends on several libraries that are notoriously version-sensitive: pyautogui, pynput, mss, opencv-python, and pydantic. Agent frameworks also depend on pydantic, and the v1-to-v2 migration has broken more projects than I can count.

The fix: Isolate OpenClaw in its own environment.

If you're running it as a separate server (which you should be), give it its own virtualenv:

python -m venv ~/.openclaw-env
source ~/.openclaw-env/bin/activate
pip install openclaw
openclaw start --verbose

Your agent framework lives in a completely separate environment and connects over the network. No shared dependencies, no conflicts. This is the cleanest architecture, and it's what the most reliable production setups use.

If you can't separate them, at least pin your versions explicitly:

# requirements.txt
openclaw==0.4.2
pydantic>=2.0,<3.0
pyautogui==0.9.54
mss==9.0.1
opencv-python-headless==4.9.0.80

Use opencv-python-headless instead of opencv-python to avoid GUI-related conflicts in headless environments.

Fix #6: Linux-Specific Display Issues

Symptoms: "No display found," "Cannot open display," or mouse/keyboard events don't register.

If you're on Linux with Wayland (the default on recent Ubuntu and Fedora), xdotool and X11-based input simulation won't work. Check which display server you're running:

echo $XDG_SESSION_TYPE

If it says wayland, you have two options:

  1. Switch to an X11 session at login (click the gear icon on the login screen and select "Ubuntu on Xorg" or similar)
  2. Use OpenClaw's Wayland-compatible mode if available — check the docs for a --backend wayland flag or ydotool-based input.

For X11 users, make sure the necessary dependencies are installed:

# Ubuntu/Debian
sudo apt install xdotool xvfb libx11-dev libxext-dev scrot

# Fedora
sudo dnf install xdotool xorg-x11-server-Xvfb libX11-devel scrot

The "I Just Want This to Work" Path

Alright, I've given you the full breakdown. But let me be honest: diagnosing and fixing all of this from scratch is a multi-hour project, especially if you're new to OpenClaw or agent frameworks in general. I've gone through this process myself, and the first time took me an entire weekend of trial and error.

If you don't want to set all this up manually, Felix's OpenClaw Starter Pack on Claw Mart is genuinely worth the $29. It includes pre-configured skills that handle the exact startup, health-checking, and permission issues I've described above. The Docker setup is already wired up, the port configuration is handled, and the agent-framework integration wrappers are pre-built with proper health checks and race-condition handling. I recommend it not because it's fancy, but because it saves you from reinventing all of these solutions yourself. It's the kind of thing I wish had existed when I was first setting up my OpenClaw environment.

A Debugging Checklist

When OpenClaw won't start, run through this in order:

  1. Can you start it standalone? Run openclaw start --verbose in a plain terminal. If this fails, it's a dependency or installation issue, not a framework issue.

  2. Check the port. Run lsof -i :8765 (or whatever port you're using). If something's there, kill it or change ports.

  3. Check permissions (macOS). System Settings → Privacy & Security → Accessibility AND Input Monitoring. Add your terminal, your IDE, and your Python executable. Restart everything.

  4. Check the display (Linux). Is $DISPLAY set? Is it X11 or Wayland? Are xdotool and scrot installed?

  5. Start it separately. Don't let your agent spawn OpenClaw. Start it in its own terminal or container, verify it's running with a health check, then connect your agent.

  6. Check the logs. Always use --verbose. The answer is almost always in the logs. If there are no logs, that itself tells you the process never started.

  7. Isolate environments. If you're getting import errors or pydantic conflicts, separate OpenClaw into its own virtualenv or container.

The Architecture That Actually Works

After months of working with OpenClaw across different projects, here's the setup I've settled on and recommend:

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”         HTTP/WS          ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   Agent Code    │ ──────────────────────── │   OpenClaw       │
│   (any framework)│     localhost:8800       │   Controller     │
│                 │                           │   (own venv/     │
│   LangGraph /   │                           │    container)    │
│   CrewAI /      │                           │                  │
│   custom        │                           │   Xvfb + screen  │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜                           ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Two separate processes. Two separate environments. Connected over the network. The agent treats OpenClaw as a remote service, not an in-process library. This is more robust, easier to debug, and scales better when you need to run multiple agents or swap out frameworks.

Your agent's tool wrapper becomes dead simple:

class OpenClawTool:
    def __init__(self, host="localhost", port=8800):
        self.client = ClawClient(host=host, port=port)
        if not self.client.ping():
            raise ConnectionError(
                f"OpenClaw not reachable at {host}:{port}. "
                "Start it with: openclaw start --port {port} --verbose"
            )
    
    def execute(self, action: str, **kwargs):
        return self.client.perform_action(action, **kwargs)

No subprocess management. No permission inheritance. No race conditions. Just a client connecting to a server that's already running and verified.

Next Steps

If you're just getting started with OpenClaw:

  1. Get it running standalone first. Don't touch agent frameworks until openclaw start --verbose works and you can send it a basic command.
  2. Set up the separate-process architecture from the start. Don't try the "all-in-one" approach. It'll bite you.
  3. If you want to skip the setup pain entirely, grab Felix's OpenClaw Starter Pack and start building your agent logic instead of fighting infrastructure.
  4. Once it's running reliably, then start building complex agent workflows on top of it.

OpenClaw is a genuinely impressive tool for giving AI agents the ability to interact with computers. The startup issues are real, but they're solvable — and once you get past them, you unlock a whole category of automation that wasn't possible before. Don't let the installation friction stop you from getting to the good stuff.

Claw Mart Daily

Get one AI agent tip every morning

Free daily tips to make your OpenClaw agent smarter. No spam, unsubscribe anytime.

More From the Blog