OpenClaw Installation Guide — All Platforms (Linux, macOS, Unraid)
Complete installation guide covering gateway setup, Ollama integration, systemd services, and troubleshooting common setup errors like ECONNREFUSED and model loading issues.
⚠️ The Problem
Users encounter various installation issues when setting up OpenClaw, including:
- Gateway won't start or is unreachable:
Gateway: unreachable (connect failed: connect ECONNREFUSED 127.0.0.1:18789)- Ollama "address already in use" error:
Error: listen tcp 127.0.0.1:11434: bind: address already in use-
Model keeps forgetting context / "Hello, who am I?" every few messages
-
NPM ENOENT errors during installation:
npm ERR! enoent ENOENT: no such file or directory-
Small models producing garbage output (raw TTS instructions, broken formatting)
-
Dashboard showing "unauthorized: gateway token missing":
disconnected (1008): unauthorized: gateway token missing (open a tokenized dashboard URL or paste token in Control UI settings)- systemd service name confusion:
Failed to enable unit: Unit file clawdbot.service does not exist.🔍 Why This Happens
These issues stem from different root causes:
-
ECONNREFUSED — The gateway daemon isn't running. OpenClaw requires the gateway to be started before you can interact with it.
-
Ollama "address in use" — This is actually normal! It means Ollama is already running as a background service. You don't need to start it again.
-
Context amnesia — The model's context window is too small, OR the model itself is too small (0.5b-3b models can't maintain coherent conversations). The Ollama docs recommend 64k context, but 128k may be the minimum that works reliably.
-
NPM ENOENT — Usually means you're in the wrong directory, node_modules is corrupted, or the file has a hidden extension like
package.json.txt. -
Garbage output from small models — Models under 7B parameters struggle with system prompts and complex instructions. The 0.5b and 3b models are essentially unusable for agent work.
-
Gateway token missing — The dashboard requires authentication. You need to open the tokenized URL from the CLI or configure the token in settings.
-
systemd naming — The service is named
clawdbot-gateway.service, notclawdbot.service.
✅ The Fix
Fresh Installation
First, ensure you have the prerequisites installed:
# Check Node.js version (need 22+)node --version# Install pnpm if you don't have itnpm install -g pnpmClone and build OpenClaw:
git clone https://github.com/clawdbot/clawdbot.gitcd clawdbotpnpm installpnpm buildRun the onboarding wizard:
pnpm clawdbot onboardThis walks you through model setup, workspace configuration, and channel connections (WhatsApp, Telegram, Discord, etc.).
Starting the Gateway
The gateway must be running for OpenClaw to work:
# Start the gatewayopenclaw gateway start# Check statusopenclaw gateway status# Enable auto-start on boot (correct service name!)sudo systemctl enable clawdbot-gatewayNote: The service is clawdbot-gateway.service, NOT clawdbot.service.
Ollama Setup
If you see "address already in use" when running ollama serve, that's fine — Ollama is already running. Verify it's working:
# Check running modelsollama ps# List installed modelsollama list# Test the APIcurl http://127.0.0.1:11434/api/tagscurl http://127.0.0.1:11434/v1/modelsImportant: Models don't load into RAM until something calls them. Test with:
openclaw chat --model ollama/deepseek-r1:14b "hello"Make sure you've pulled the model first:
ollama pull deepseek-r1:14bFixing Context Amnesia
If your bot keeps forgetting who it is every 2-3 messages, the context window is too small or the model is too weak.
Minimum viable models for CPU:
- Qwen2.5 7B
- Llama3 8B
For reliable performance: 14B+ models recommended
Check your Ollama model's context settings. The default 64k may not be enough — try 128k if you have the VRAM:
# Check VRAM usage while model is loadednvtopFixing NPM ENOENT Errors
# Make sure you're in the project rootcd /path/to/clawdbotls package.json # Should show the file# Clear and reinstallrm -rf node_modules package-lock.jsonpnpm installOn Windows, check if the file has a hidden extension:
ls -la | grep package# If it shows package.json.txt:ren "package.json.txt" package.jsonComplete Uninstall & Fresh Start
# Stop and remove the daemonopenclaw daemon stopopenclaw daemon uninstall# Delete all OpenClaw datarm -rf ~/.clawdbot# Optional: delete workspacerm -rf ~/clawd# Fresh installgit clone https://github.com/clawdbot/clawdbot.gitcd clawdbotpnpm installpnpm buildpnpm clawdbot onboardDebugging Tips
Run these commands to diagnose issues:
# Deep status checkopenclaw status --deep# Watch logs in real-timeopenclaw logs --follow# Check versionopenclaw --version🔥 Your AI should run your business, not just answer questions.
We'll show you how.Free to join.
📋 Quick Commands
| Command | Description |
|---|---|
| openclaw gateway start | Start the gateway daemon |
| openclaw gateway status | Check if gateway is running |
| sudo systemctl enable clawdbot-gateway | Enable auto-start on boot |
| ollama ps | List currently running Ollama models |
| ollama list | List all installed Ollama models |
| ollama pull <model> | Download a model |
| openclaw status --deep | Deep diagnostic check |
| openclaw logs --follow | Watch logs in real-time |
| curl http://127.0.0.1:11434/api/tags | Test Ollama API |
| rm -rf node_modules && pnpm install | Clean reinstall dependencies |
Related Issues
📚 You Might Also Like
Set Up OpenClaw for Beginners
30-Minute Setup Guide
OpenClaw Free Download: Install on Mac, Linux, Windows, Pi
OpenClaw is free to download and open source. npm, Homebrew, Docker, or direct binary — full install guide for every platform.
Top 5 Ways to Install OpenClaw (2026 Guide)
The easiest way to install OpenClaw is OpenClaw Cloud at cloud.getopenclaw.ai — instant setup, no installation required. Or self-host via Docker, npm, Homebrew, or source.
🐙 Your AI should run your business.
Weekly live builds + template vault. We'll show you how to make AI actually work.Free to join.
Join Vibe Combinator →