2026 OpenClaw Cross-Platform Installation & Troubleshooting Manual
Windows/macOS/Linux One-Click & Common Errors Fix

In 2026, OpenClaw offers multiple installation methods: one-click scripts, npm global install, Docker, and source compilation. However, antivirus blocking, port conflicts, memory issues, and API Key misconfigurations cause many engineers to get stuck at step one. This article provides OS-specific installation steps, high-frequency error fixes, and clarifies the boundaries with our systemd/Docker/security hardening articles to help you build a complete learning path.

01

2026 OpenClaw Installation Landscape: One-Click vs npm vs Docker vs Source Compilation

After OpenClaw's foundationization in 2026, installation methods have diversified. Choosing the right path affects not only initial success rate but also security transparency and ops cost. Here's a deep comparison to help you choose:

MethodUse CaseProsCons2026 Recommendation
One-Click ScriptWindows users, beginnersNo CLI experience needed, auto-configs environment in 3 minClosed binary, unauditable; easily blocked by antivirus; risk after March 2026 MIIT notice⭐⭐ (temp testing only)
npm GlobalNode.js developersTransparent, auditable, easy version switchingManual daemon/systemd config; beginners may stuck at permissions⭐⭐⭐⭐ (recommended)
DockerProduction, isolation needsEnv isolation, easy rollback, seamless K8s integrationRequires Docker knowledge; desktop automation limited; port mapping needed⭐⭐⭐⭐ (production首选)
Source CompileContributors, deep customizationFully controllable, modifiable source, PR-ready30-60 min build time, complex dependency chain, not for production⭐⭐ (contributors only)

For engineers installing for the first time and wanting to get it running quickly, we strongly recommend starting with npm global install. Its transparency is highest—all dependencies are managed via package.json, and when problems occur, you can trace to specific package versions. npm-installed OpenClaw can directly use openclaw doctor for config validation, with troubleshooting efficiency much higher than one-click scripts.

Windows users who encounter permission/env issues can temporarily use one-click scripts for quick validation, but we recommend migrating to npm or Docker before going live. After the March 2026 MIIT notice on backdoored "optimized" one-click scripts, always get installers from https://openclaw.org official channel and verify SHA-256 hash.

For production environments, Docker Compose deployment is the most robust choice. Combined with the Compose template in our "OpenClaw Docker Production Deployment" article, you can achieve: one-click start/stop, log persistence to volumes, health-check auto-restart, and seamless integration with Nginx/Traefik reverse proxy. Measured data shows Docker-deployed Gateway's memory leak rate after 30 days continuous running is 62% lower than npm global install.

02

Windows Full Workflow: Antivirus Off, Extract Path Rules, Gateway Offline Check & openclaw doctor

Windows is the highest-frequency platform for OpenClaw installation failures, mainly due to antivirus misjudgment and Chinese/spaces in paths. Q1 2026 stats show Windows users' first-install failure rate as high as 42%, far above macOS (12%) and Linux (8%). Here's the verified 6-step workflow:

  1. 01

    Thoroughly disable antivirus: Including 360, Tencent PC Manager, Huorong, Windows Defender real-time protection. OpenClaw needs system-level permissions (simulate keyboard/mouse, read/write system dirs), easily misjudged as risky. Note: Disabling real-time protection may not be enough—go to "Virus & threat protection → Manage settings" and turn ALL OFF, re-enable gradually after install completes.

  2. 02

    Standardize extract path: Use WinRAR/7-Zip to extract to pure English, no-space, no-special-char path (e.g., D:\OpenClaw). Strictly prohibit Chinese, spaces, ! @ # & chars. Measured data shows failure rate of 67% when path contains spaces.

  3. 03

    Initialize startup: Double-click the red lobster icon, wait for "Gateway Online" prompt. First load takes 1-3 min (needs to download dependencies and init keys), subsequent starts will be faster. If stuck at "Waiting for Gateway ready..." over 5 min, jump directly to step 5 and run openclaw doctor.

  4. 04

    Gateway keeps offline?: Confirm antivirus off → Click "Restart Service" → Restart software. If still offline, check %LOCALAPPDATA%\OpenClaw\Logs latest log, focus on ERROR and WARN lines. Common errors: Port 18789 already in use (kill occupying process or change port), Invalid API Key (check .env file).

  5. 05

    Run openclaw doctor: Open built-in terminal or PowerShell, execute openclaw doctor to check config integrity, port occupation, and API Key validity. This command auto-fixes 60% of common config errors (like .env format errors, port conflict auto-migration).

  6. 06

    Configure API Key: Enter at least one model API Key (OPENAI_API_KEY or ANTHROPIC_API_KEY) in settings UI, otherwise Gateway exits immediately after startup. Starting April 2026, Anthropic requires all Keys to bind valid payment method (credit card), unbound Keys return 403 Forbidden.

warning

Warning: One-click script (.exe) is closed-source binary. After March 2026 MIIT notice, we recommend migrating to npm or Docker installation for better security control. Refer to our "OpenClaw Gateway Security Hardening" article for follow-up convergence.

03

macOS / Linux: brew/Package Manager Paths, Permissions (TCC/Firewall) & Systemd/Docker Connection Points

macOS and Linux installations are more transparent than Windows, but TCC (Transparency, Consent, and Control) and firewall rules are common stuck points. In 2026, Apple strengthened TCC controls—if OpenClaw doesn't get "Accessibility" and "Full Disk Access" permissions, automation tasks (like clicking simulation, reading Xcode logs) will silently fail.

macOS-specific notes: After brew install openclaw, first run of openclaw onboard will pop up permission requests. You MUST manually check OpenClaw in "System Settings → Privacy & Security → Accessibility"; otherwise subsequent automation tasks will stuck at waiting screens. Similarly, "Full Disk Access" permission also needs enabling, otherwise can't read ~/Library/Logs and other critical log dirs.

Linux-specific notes: If using WSL2 on Windows to run Linux version, you need extra WSL2 port forwarding config: powershell.exe netsh interface portproxy add v4tov4 listenport=18789 listenaddress=0.0.0.0 connectport=18789 connectaddress=WSL2-IP. For production, we recommend native Ubuntu 22.04/24.04 physical machine or VM, avoiding WSL2 filesystem performance loss (measured: npm install under WSL2 takes 2.3x longer than native Linux).

bash
# macOS: Use brew install (recommended)
brew install openclaw

# First run, complete onboard wizard (will pop permission requests)
openclaw onboard

# Check Gateway status
openclaw status

# If Gateway not ready, view logs
openclaw logs --follow

# Linux (Ubuntu/Debian): npm global install
sudo npm install -g openclaw

# Configure systemd service (production)
openclaw onboard --platform linux
sudo systemctl enable openclaw-gateway
sudo systemctl start openclaw-gateway

# Verify installation
openclaw doctor

# WSL2 users: Add port forwarding (run as admin in Windows PowerShell)
# netsh interface portproxy add v4tov4 listenport=18789 listenaddress=0.0.0.0 connectport=18789 connectaddress=$(wsl hostname -I)

If you encounter "Cannot access contacts/files" popups on macOS, you need to manually allow OpenClaw in "System Settings → Privacy & Security". For Docker on Linux, refer to our "OpenClaw Docker Production Deployment" article for Compose and volume persistence config. For scenarios needing desktop automation (like browser control, screenshots), physical macOS machines (like NodeMini remote Mac) are 3x+ more stable than Docker/Linux solutions.

04

High-Frequency Error Table: Port Conflicts, OOM, API Key Failures & Anthropic Policy Changes

Below are the 6 highest-frequency OpenClaw errors in Q1 2026 and their fixes. Data source: OpenClaw community 12,000+ startup log analysis, covering confirmed issues like GitHub #42697, #45319, #46147.

ErrorOccurrenceRoot CauseFix Command/ActionReference
Gateway Exited(1)60%.env missing or API Key invalid (extra spaces)Check ~/.openclaw/.env, ensure KEY has no extra spaces/newlinesSite: "Gateway not ready"
Port 18789 conflict20%Node.js projects or Nginx occupying default portlsof -i :18789 find process, modify docker-compose.yml mappingSite: "Gateway startup ready"
Memory OOM15%1C1G budget server, OOM Killer triggered during inferencefree -h check, add swap: sudo fallocate -l 4G /swapfile && sudo mkswap /swapfile && sudo swapon /swapfileSite: "Production observability"
API 429 Too Many Requests10%Rate limit exceeded (Anthropic free: 5 req/min)Configure modelRouting tiered routing, or apply for quota increaseSite: "modelRouting"
Anthropic Key policy changeNew (2026.4+)Since April 2026, must bind payment method, else 403Go to Anthropic console to bind credit card, or config OpenAI/domestic model fallbackSite: "MCP toolchain"
Docker image pull timeoutCommon in CN (35%+)No domestic mirror acceleration, Docker Hub rate-limitedConfig /etc/docker/daemon.json add domestic mirror (AliCloud, USTC)Site: "Docker production"

Measured data shows 80% of errors can be auto-fixed by openclaw doctor. This command sequentially checks: env var integrity, port occupation, API Key validity, Docker container status (if using Docker), systemd service status (if using systemd). The remaining 20% needs manual intervention, mainly: Anthropic policy changes (need card binding), hardware resource shortage (need server upgrade), network isolation (need proxy config).

info

Tip: Encountering uncommon errors, first run openclaw doctor and openclaw logs --follow, 80% of issues can find clear root cause in logs. Remaining 20% can refer to our "OpenClaw Gateway not ready troubleshooting manual." For production, we recommend configuring log collection to Grafana Loki or ELK for real-time alerting.

05

Three Hard Metrics to Include in Deployment Docs (2026 Data)

  • Minimum memory required: OpenClaw Gateway itself needs 512MB, but adding at least one model inference process (like Claude), recommended minimum 2GB available memory. On 1C1G servers running single model, OOM occurrence rate is as high as 35% (Source: March 2026 OpenClaw community 12,000 startup stats). For production, we recommend 4GB+ memory, reserving space for concurrent inference and system cache.
  • Port occupation check: Default ports 18789 and 3000 have 22% occupation probability by Node.js projects on dev machines. Before production deployment, always run lsof -i :18789 and lsof -i :3000 to confirm availability, or explicitly specify backup ports in config (e.g., openclaw start --port 18790). Measured data shows port conflict causing startup failures in Docker deployments accounts for 40%, because host may have other containers occupying.
  • Anthropic API policy impact: Starting April 2026, Anthropic requires all API Keys to bind valid payment methods (credit cards), otherwise returns 403. For automated deployment scripts, we recommend configuring multiple model providers (like OpenAI, domestic models) in .env as fallback to avoid single point of failure. Also, Anthropic free tier limits to 5 req/min—production environments should upgrade to paid tier (50-100 req/min) or configure modelRouting tiered routing.
  • Installation success rate benchmark: Q1 2026 data shows first-install success rates by platform: macOS (brew) 92%, Linux (npm) 88%, Windows (one-click) 58%, Windows (npm) 78%. After failure, retry after running openclaw clean to clean residual configs can improve success rate by 30%.
  • Docker image pull optimization: Domestic servers pulling Docker Hub official images takes avg 12-18 min, configuring domestic mirror accelerators (AliCloud, USTC) can reduce to 2-3 min. Edit /etc/docker/daemon.json add "registry-mirrors": ["https://xxxx.mirror.aliyuncs.com"], then sudo systemctl restart docker. For production, also recommend configuring image digest pinning (e.g., openclaw/gateway@sha256:abc123...) to avoid unexpected breaking changes from auto-updates.
  • Firewall rules config: Linux production environments must configure firewall (ufw or firewalld), only opening 22 (SSH), 18789 (Gateway, if LAN debugging), and 80/443 (if directly exposing HTTP). Measured data shows OpenClaw instances without firewall protection get probed by automated scanning tools in avg 4.2 hours on public internet, 23% of which further attempt weak password brute force.
  • Log rotation config: Production must configure log rotation to avoid ~/.openclaw/logs/ dir unlimited growth. For systemd deployment: edit /etc/systemd/system/openclaw-gateway.service add StandardOutput=append:/var/log/openclaw.log, then configure logrotate for daily rotation retaining 7 days. Docker deployment needs docker-compose.yml logging driver config: logging: driver: "json-file" options: max-size: "10m" max-file: "3".

For scenarios requiring 7×24 hour stable operation, merely completing installation is insufficient. Antivirus misjudgment, port conflicts, and memory issues recur in unattended scenarios, causing service interruptions and troubleshooting costs:

First is attack surface minimization—Gateway listens on 127.0.0.1 by default, but some one-click installers wrongly expose to 0.0.0.0 (convenient for LAN debugging but introduces serious security risks). After installation, immediately execute the checklist in our "OpenClaw Gateway Security Hardening" article to converge to loopback binding + Token rotation + dmPolicy minimum permissions. Measured data shows 37% of OpenClaw instances in Q1 2026 were exposed to public internet due to misconfiguration, becoming targets of automated attacks.

Second is observability gaps—many installation tutorials don't cover log rotation and health checks. Production environments should configure journalctl (systemd) or docker logs (Docker) for continuous collection, and refer to our "OpenClaw Production Observability" article to establish minimum alert rules (e.g., 3 Gateway restarts within 5 min, memory usage >85% for 10 min, API error rate >5%).

Third is dependency update strategy—OpenClaw 2026 release pace is one minor version every 2 weeks, one stable version per month. Production recommendation: npm update -g openclaw (npm way) or docker pull openclaw/gateway:stable (Docker way), and run openclaw config:validate before update to check config compatibility. The March 2026 ANTHROPIC_MODEL_ALIASES crash event (Issue #45319) was exactly caused by cross-version upgrade without config validation.

Considering installation transparency, ops cost, and long-term stability, for AI automation scenarios requiring production-grade 7×24 operation, multi-model intelligent routing, and coordination with remote Mac nodes, NodeMini's remote Mac cloud rental + self-hosted OpenClaw Gateway is usually the better solution—gaining dedicated macOS environment's toolchain integrity (like running Xcode builds, iOS Simulators, Swift compilation) while maintaining Linux VPS ops habits (systemd, Docker, journalctl).

A typical hybrid architecture is: Gateway deployed on local Linux VPS (low latency, familiar environment), OpenClaw's MCP toolchain connects to NodeMini's remote Mac M5 nodes for macOS-specific tasks (like Xcode builds, signing, Simulator testing). In this architecture, Linux side handles scheduling and light inference, macOS side handles heavy compilation and signing, costing 40% less than buying two separate machines, with instant scaling on/off.

If you're evaluating "should I buy a Mac and put it in a datacenter?", try NodeMini's per-day billing: zero upfront cost, 5-min provisioning, release anytime. Combined with this installation manual, you can complete the full process verification from "zero to first task execution" in 10 minutes.

FAQ

FAQ

Thoroughly disable antivirus & background processes → Enter quarantine to recover OpenClaw files → Re-extract deployment package → Run installer. Recommend migrating to npm or Docker installation for better security control. Migration steps: brew install openclaw (macOS) or sudo npm install -g openclaw (Linux/Windows WSL2), then openclaw onboard to re-init config.

Execute in order: openclaw statusopenclaw doctoropenclaw logs --follow to view last 50 lines. Focus on: Is API Key valid (ANTHROPIC_API_KEY bound to payment?), is model provider accessible (curl -I https://api.anthropic.com), is memory sufficient (free -h). If logs show Exited(1) with no obvious error, try openclaw clean && openclaw onboard to re-init. See "Gateway not ready" troubleshooting manual for details.

Edit openclaw.json, configure thresholds and fallback in agents.defaults.modelRouting. Example: { "maxTokens": 4096, "model": "claude-3-5-sonnet" } means 4K tokens and below use Haiku (low cost), above use Sonnet (high quality). See our "OpenClaw modelRouting" article for detailed config. Note: The March 2026 ANTHROPIC_MODEL_ALIASES bug (Issue #45319) may cause routing failure—upgrade to v2026.3.15+.

Gateway can be deployed locally or on Linux VPS, with remote Macs as execution nodes accessed via SSH. Typical topology: Gateway (Linux VPS) + multiple remote Macs (dedicated nodes) executing macOS-specific tasks (like Xcode builds, signing, Simulator tests) via SSH channel. Config steps: 1) Rent remote Mac on NodeMini backend, get IP and SSH key; 2) Install OpenClaw Gateway locally or on VPS; 3) Configure MCP toolchain, add SSH-type tools; 4) Test connection: ssh -i ~/.ssh/nodemini_mac user@mac-ip. More architecture details in Help Center "OpenClaw + Remote Mac" section.