How to Set Up OpenClaw: Complete Beginner's Guide 2026
From zero to your first AI agent in under 30 minutes. Install, configure, connect to Discord, and start automating.
📋 What You'll Need
- • A Mac, Linux, or Windows (WSL) machine
- • Node.js 20+ installed
- • An LLM API key (Anthropic, OpenAI, or any OpenAI-compatible provider)
- • A Discord bot token (optional but recommended)
- • ~30 minutes of your time
Step 1: Install Node.js
OpenClaw requires Node.js 20 or later. Check your version:
$ node --version
v22.22.0
If you don't have it, install via nodejs.org or use a version manager like nvm or fnm.
Step 2: Install OpenClaw
$ npm install -g openclaw
Verify the installation:
$ openclaw --version
Step 3: Initialize Your Workspace
OpenClaw uses a workspace directory (default: ~/.openclaw/workspace) to store your agent's memory and configuration.
$ openclaw init
This creates the workspace structure:
~/.openclaw/workspace/
├── SOUL.md # Your agent's personality
├── AGENTS.md # Agent behavior instructions
├── USER.md # Info about you (the human)
├── TOOLS.md # Local tool configuration
├── daily/ # Daily notes (auto-created)
├── tacit/ # Tacit knowledge about you
└── life/ # PARA-organized knowledge graph
├── projects/
├── areas/
├── resources/
└── archives/
Step 4: Configure Your LLM
Set your preferred model and API key. OpenClaw supports any OpenAI-compatible API:
# For Anthropic Claude
$ export ANTHROPIC_API_KEY=sk-ant-...
# For OpenAI
$ export OPENAI_API_KEY=sk-...
# Configure in OpenClaw
$ openclaw config set model anthropic/claude-sonnet-4-20250514
Step 5: Customize Your Agent's Soul
Edit SOUL.md to define your agent's personality. This is the most important file — it determines how your agent communicates and behaves:
# SOUL.md
Be genuinely helpful, not performatively helpful.
Have opinions. Be resourceful before asking.
Earn trust through competence.
## Vibe
Concise when needed, thorough when it matters.
Not a corporate drone. Not a sycophant. Just good.
Step 6: Connect Discord (Optional)
To give your agent a presence on Discord:
- Create a Discord bot at discord.com/developers
- Enable Message Content Intent under Bot settings
- Invite the bot to your server with appropriate permissions
- Set your bot token:
$ openclaw config set discord.token YOUR_BOT_TOKEN
Step 7: Start the Gateway
$ openclaw gateway start
Your agent is now live! It will respond to messages in Discord, maintain its own memory, and follow the personality you defined in SOUL.md.
Step 8: Understanding the Memory System
OpenClaw uses a three-layer memory system that persists across sessions:
Layer 1: Knowledge Graph (life/)
Structured long-term memory using the PARA method — Projects, Areas, Resources, Archives.
Layer 2: Daily Notes (daily/)
One file per day. Raw, chronological logs of what happens during conversations.
Layer 3: Tacit Knowledge (tacit/)
Personal knowledge about you — preferences, workflows, rules, lessons learned.
Step 9: Heartbeats & Proactive Behavior
OpenClaw agents can be proactive via heartbeats — periodic check-ins where your agent can check email, calendar, weather, and more. Configure heartbeat intervals and define what your agent should check in HEARTBEAT.md.
Next Steps
- 📖 OpenClaw Documentation — Full reference
- 🐙 GitHub Repository — Source code and issues
- 🤖 Multi-Agent Tutorial — Build an army of agents
- ⚔️ OpenClaw vs Claude Code — How it compares
Vastik Agrawal
AI & Cybersecurity Analyst at Inside Cyber
Vastik Agrawal is a cybersecurity professional with over 10 years of experience in endpoint security, threat detection, and incident response. He has worked with leading security companies protecting enterprise environments worldwide.