Why Rent an Agent When You Can Own One?
In the rapidly evolving world of Artificial Intelligence, most of us are used to chatting with a bot in a browser. But what if your AI lived on your machine, had access to your files, could text you on WhatsApp, and executed tasks while you slept?
Enter OpenClaw.
Formerly known as ClaudeBot or MoltBot, OpenClaw is a proactive autonomous agent runtime that allows you to host a personal assistant capable of executing real-world tasks. From managing your calendar to triaging emails and controlling smart home devices, OpenClaw connects the intelligence of LLMs (like Claude 3.5 Sonnet or Opus) directly to your digital life.
In this guide, we’ll walk you through everything you need to know to get started with OpenClaw, based on the latest FreeCodeCamp course by Kian.
Key Differences from Claude Code
While the terminal interface might look similar to Anthropic’s "Claude Code," OpenClaw is distinct because:
1. Fully Self-Hosted
You own the config, the execution environment, and the data.
2. Native Integrations
It supports WhatsApp, Discord, and Telegram out of the box.
3. High Configurability
You define the agent's personality, memory, and permissions via simple Markdown files.
Step 1: Installation and Setup
Prerequisites
- Node.js: Version 22 or higher (Version 25 is recommended).
- CLI Experience: You should be comfortable running commands in a terminal.
- LLM API Key: Access to Anthropic (Claude) or Google (Gemini) models.
Installation
OpenClaw is installed via npm. Open your terminal and run:
npm install -g openclaw
Once installed, kick off the onboarding wizard:
openclaw onboard --install-daemon
The --install-daemon flag is crucial as it sets up OpenClaw as a background service (using launchd on macOS or systemd on Linux), ensuring your agent stays alive even when you close the terminal.
⚠️ Security Warning: By default, OpenClaw runs with the permissions of your user account. If you install it locally on your Mac/PC, it has root access to your files. For maximum security, it is highly recommended to run OpenClaw on a Virtual Private Server (VPS) or use Docker Sandboxing (discussed later).
Step 2: Understanding the Workspace & Memory
OpenClaw’s "brain" is nothing more than a folder of Markdown files, typically located in ~/.openclaw. This makes it incredibly easy to backup (using Git) and modify.
The primary instruction file defining the agent's behavior.
Defines who the agent is (e.g., "Nova, a helpful coding assistant").
A scheduler file. Tells the agent to "check emails every hour" etc.
A scratchpad where the agent learns about the tools it can use.
Persistent storage where the agent records context.
Step 3: Extending Capabilities with Skills
"Skills" in OpenClaw are like plugins. They are Markdown files that teach the LLM how to use specific CLIs or APIs. You can install skills from the ClawHub (conceptually similar to pip or npm) or write your own.
Popular Skills
- Obsidian: Read/write to your Obsidian vault.
- Apple Notes: Manage notes via the memo CLI.
- Himalaya: Read, write, and reply to emails via CLI.
- Pinchboard: "Social media for agents" skill to interact with other AI agents.
Creating a Custom Skill
Creating a skill is as simple as asking OpenClaw to write a Python script. For example, you can ask your agent:
The agent will generate the script, create a skill.md definition, and immediately be able to use that new capability.
Step 4: Connecting to the World
One of OpenClaw's coolest features is talking to your agent via standard messaging apps.
WhatsApp Integration
- Run
openclaw channels login. - Scan the QR code with your phone (Linked Device).
- Your agent is now connected! Text it "Check my pull requests" from anywhere.
Discord Integration
- Create a Bot in the Developer Portal.
- Enable "Message Content Intent".
- Provide OpenClaw with the Bot Token and Channel ID.
- Your agent will join the server and respond to mentions.
Step 5: Advanced Security & Sandboxing
Giving an AI root access to your computer is risky. Prompt Injection attacks could theoretically trick your agent into deleting files. To mitigate this, OpenClaw offers robust Docker Sandboxing.
How to Sandbox Your Agent
You can isolate specific agents (e.g., a "Work" agent vs. a "Personal" agent) in Docker containers.
- Ensure Docker Desktop is running.
- Run the sandbox setup script (provided in the OpenClaw repo).
- Ask OpenClaw: "Can you make the work agent sandboxed on the agent scope?"
Once sandboxed, if you ask the agent "Read files on my desktop," it will refuse, stating it only has access to its containerized environment. This is perfect for testing untrusted code or running high-risk agents.