The definitive OpenClaw setup guide. From choosing an installation method to running your first automated workflow — every step explained with copy-paste commands, configuration examples, and troubleshooting tips. Whether you're on macOS, Linux, or Windows WSL, you'll be productive in under 30 minutes.
Before installing OpenClaw, ensure your system meets these requirements: Operating System: - macOS 13+ (Ventura or later) - Ubuntu 22.04+ or Debian 12+ - Windows 11 with WSL2 (Ubuntu recommended) - Other Linux distributions: tested on Fedora 39+, Arch, and Alpine Runtime: - Node.js 20+ (LTS recommended) - npm 10+ or pnpm 9+ - Git 2.40+ Hardware (minimum): - 4GB RAM (8GB recommended) - 2GB free disk space - Stable internet connection for API calls API Keys (at least one): - OpenAI API key (GPT-4o, GPT-5) — most widely supported - Anthropic API key (Claude 4, Claude 3.5) — best for coding tasks - Google AI key (Gemini 2) — best value for cost-conscious users - Local models via Ollama — no API key needed, requires 16GB+ RAM For deployment security, read our security guide before exposing OpenClaw to production workloads.
The fastest way to get started — no global install required: `npx clawhub@latest` This downloads the latest version, runs the interactive setup wizard, and creates your configuration file at `~/.openclaw/config.yaml`. Setup wizard steps: 1. Choose your primary LLM provider (OpenAI / Anthropic / Google / Local) 2. Enter your API key 3. Choose a default model (wizard recommends based on your use case) 4. Enable/disable memory (conversation history) 5. Install starter skills (optional — we recommend starting with Deep Research and GPT Prompt Chainer) After setup: OpenClaw starts in interactive mode. Type your first prompt and watch it work. For skill recommendations, see our how to choose skills guide.
For production deployments, Docker provides isolation and reproducibility: `docker run -it --name openclaw -v ~/.openclaw:/root/.openclaw clawhub/openclaw:latest` Security-hardened version (follow our security guide): `docker run -it --name openclaw --cap-drop ALL --read-only --tmpfs /tmp:rw,noexec,nosuid --security-opt no-new-privileges:true -v /host/data:/data:ro -v /host/output:/output:rw clawhub/openclaw:latest` Docker Compose for persistent configurations: Create a `docker-compose.yml` with the clawhub/openclaw image, your environment variables (never hardcode API keys — use Docker secrets or a .env file excluded from version control), and volume mounts for data and output. The Docker Captain skill can generate optimized Docker configurations tailored to your use case.
For developers who want to modify OpenClaw's core: `git clone https://github.com/openclaw/openclaw.git && cd openclaw && npm install && npm run build && npm link` Benefits of source install: - Modify core behavior - Debug skill execution - Test pre-release features - Contribute upstream patches Downsides: - Manual updates (no auto-update) - Build time (~60 seconds) - More complex dependency management For a lighter alternative with full source transparency, consider Nanobot — its entire codebase is under 5,000 lines.
OpenClaw supports 20+ LLM providers. Here's how to optimize your configuration: For best quality: GPT-5 or Claude 4 Opus. Expect $0.05-0.15 per complex task. Best for coding, research, and long-form content. For best value: GPT-4o-mini or Claude 3.5 Haiku. Expect $0.001-0.01 per task. Sufficient for most routine tasks. For privacy: Ollama with Llama 3.3 or Mistral Large locally. No API costs, but requires 16GB+ RAM and quality is lower for complex tasks. For automatic optimization: Install the LLM Router skill. It analyzes each task's complexity and routes to the cheapest model that can handle it. Teams report 60-70% cost reduction with no quality loss. Multi-provider setup: Configure multiple providers in `~/.openclaw/config.yaml` as fallbacks. If OpenAI is down, OpenClaw automatically routes to Anthropic. Use Token Counter for real-time cost tracking. For detailed cost analysis of different hosting approaches, see our OpenClaw vs Moltworker comparison.
After installation, activate your first skills: `npx clawhub@latest install deep-research gpt-prompt-chainer` Verify installation: `npx clawhub@latest skills list` — shows all installed skills with their status. First workflow — Research a topic: Prompt: 'Research the current state of autonomous AI agents in 2026. Focus on security, cost, and ecosystem size. Output a structured report with citations.' With Deep Research active, OpenClaw will: 1. Search multiple sources (web, academic databases, news) 2. Extract and synthesize key findings 3. Verify facts across sources 4. Generate a cited report First workflow — Chain a multi-step task: Prompt: 'Write a blog post about AI agent security. First research the topic, then outline the post, then write each section, then edit for clarity.' With GPT Prompt Chainer active, OpenClaw will execute each step sequentially, passing context between steps. For curated skill stacks by use case, see our skill selection guide. For the complete skill catalog, browse the directory.
OpenClaw becomes truly powerful when it runs autonomously on a schedule: Cron jobs: Schedule recurring tasks like daily research summaries, weekly report generation, or hourly monitoring checks. Add entries to your crontab that invoke OpenClaw with specific prompts and skill configurations. Telegram integration: Run OpenClaw as a Telegram bot for mobile access. Send prompts from your phone, receive formatted responses, and manage workflows on the go. Configuration is done in `~/.openclaw/integrations/telegram.yaml`. Webhook triggers: Expose an HTTP endpoint that triggers OpenClaw workflows. Useful for CI/CD pipelines (trigger code review on PR), monitoring (trigger investigation on alert), and business workflows (trigger lead processing on form submission). Discord/Slack integration: Similar to Telegram — run OpenClaw as a bot in your team's communication channels. See our Slack guide for configuration details. Important: Automated workflows should use the Docker installation method with security hardening. Never expose webhook endpoints without authentication. Rate-limit automated tasks to control API costs.
'Model not responding' errors: Check API key validity. Verify network connectivity to the provider. If using Docker, ensure the container has outbound access to API endpoints. Try a different provider as fallback. 'Skill not found' errors: Run `npx clawhub@latest skills list` to verify installation. Check the skill name is correct (case-sensitive). If installed but not loading, check `~/.openclaw/logs/` for specific errors. High API costs: Install LLM Router to automatically route simple tasks to cheaper models. Use Token Counter to identify which skills consume the most tokens. Consider using local models via Ollama for non-critical tasks. Slow responses: Reduce active skills — each active skill adds overhead. Check if the model is appropriate for the task (smaller models respond faster). If using Docker, ensure the container has sufficient memory allocated. Memory/conversation issues: Conversation history is stored in `~/.openclaw/conversations/`. Delete old conversations to free space. For long-running projects, consider the Context Window Manager skill to manage context efficiently. For advanced memory, see our memU comparison. Permission errors: If running in Docker, check volume mounts. If running natively, ensure the OpenClaw user has appropriate filesystem permissions. Never run as root — see our security guide.
How long does installation take? The npx method takes under 2 minutes. Docker setup takes 5 minutes. Source build takes 10 minutes including dependency installation. Can I use multiple LLM providers simultaneously? Yes. Configure multiple providers in config.yaml and use LLM Router to automatically select the best provider per task. You can also specify a provider per skill. Is OpenClaw free? OpenClaw itself is free and open-source (Apache 2.0 license). You pay for LLM API usage. Local models via Ollama eliminate API costs entirely. Browse free skills in our directory. Does OpenClaw work offline? With local models (Ollama), yes — for basic tasks. Skills that require internet access (web search, API calls) won't work offline. Core agent functionality (file editing, local tool execution) works without internet. How do I update OpenClaw? npx users get the latest version automatically. Docker users: `docker pull clawhub/openclaw:latest`. Source users: `git pull && npm install && npm run build`. Can I run OpenClaw on a Raspberry Pi? Technically yes, but performance will be limited. OpenClaw requires ~200MB RAM minimum. A Pi 4 with 8GB works for basic tasks with local models. For production, we recommend a VPS — see our cost analysis in the Moltworker comparison.