From zero to a running AI agent on your Mac or Linux machine. No cloud accounts required — just Node.js and an API key.
OpenClaw runs on Node.js. Install from nodejs.org or use brew install node on Mac.
At least one: Anthropic, OpenAI, Google AI, or OpenRouter.
A Telegram bot token (from @BotFather), WhatsApp, or Discord bot for your agent to communicate through.
Use npm to install the OpenClaw CLI. This gives you the openclaw command globally.
$ npm install -g openclaw
Run init to create the configuration directory and default config file at ~/.openclaw/.
$ openclaw init
✓ Created ~/.openclaw/config.yaml
✓ Created ~/.openclaw/workspace/
Edit ~/.openclaw/config.yaml and add your API key. Example with Claude:
models:
default: anthropic/claude-sonnet-4
providers:
anthropic:
apiKey: sk-ant...here
openai:
apiKey: ***
google:
apiKey: your-gemini-key
Add your Telegram bot token (or WhatsApp/Discord config) to the channels section:
channels:
telegram:
botToken: "123456:ABC-DEF..."
allowedUsers:
- your_telegram_id
Launch OpenClaw. Your AI agent is now live and listening on your configured channels.
$ openclaw gateway start
⚡ Gateway running on port 3333
✓ Telegram bot connected
✓ Model: claude-sonnet-4 ready
# Send a message to your bot on Telegram — it works!
Once your agent is running, try these commands from your Telegram chat:
Running on your laptop is great for testing. For always-on operation, deploy to a VPS.