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
Gateway: unreachable (connect failed: connect ECONNREFUSED 127.0.0.1:18789)
2. **Ollama "address already in use" error:**
Error: listen tcp 127.0.0.1:11434: bind: address already in use
3. **Model keeps forgetting context / "Hello, who am I?" every few messages**
4. **NPM ENOENT errors during installation:**
npm ERR! enoent ENOENT: no such file or directory
5. **Small models producing garbage output** (raw TTS instructions, broken formatting)
6. **Dashboard showing "unauthorized: gateway token missing":**
disconnected (1008): unauthorized: gateway token missing (open a tokenized dashboard URL or paste token in Control UI settings)
7. **systemd service name confusion:**
Failed to enable unit: Unit file clawdbot.service does not exist.
🔍 Why This Happens
package.json.txt.
5. 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.
6. Gateway token missing — The dashboard requires authentication. You need to open the tokenized URL from the CLI or configure the token in settings.
7. systemd naming — The service is named clawdbot-gateway.service, not clawdbot.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:14b## Fixing 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 loadednvtop## Fixing 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.json## Complete 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 onboard## Debugging 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.$97/mo (going to $197 soon)
📋 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
Zoom
Transform how you handle meetings. Schedule calls via chat, get AI meeting summaries, process transcripts automatically, and sync with your calendar — all hands-free.
Self-Hosted AI Assistant: The Complete 2026 Guide
Want complete control over your AI assistant? Self-hosting means your data stays on your hardware, your conversations remain private, and you can customize everything. This guide covers it all.
🐙 Your AI should run your business.
Weekly live builds + template vault. We'll show you how to make AI actually work.$97/mo (going to $197 soon)
Join Vibe Combinator →