5.7 KiB
5.7 KiB
OpenClaw Setup Guide
OpenClaw: Personal AI Assistant that executes actions (emails, calendar, shell commands, API integrations)
Quick Setup
1. Configure Secrets
Edit ~/.openclaw_secrets with your API keys:
nano ~/.openclaw_secrets
Fill in:
ANTHROPIC_API_KEY- Claude API from AnthropicOPENAI_API_KEY- GPT-4 / Codex from OpenAIGITHUB_TOKEN- GitHub Copilot API accessTWILIO_*- WhatsApp integration (optional)TELEGRAM_*- Telegram bot integration (optional)
2. Load Secrets
source ~/.openclaw_secrets
Or they auto-load when you open a new shell (bashrc sources them).
3. Start Service
cd ~/mydocker
docker-compose up -d openclaw
Access OpenClaw
Web UI
- URL: https://openclaw.sebson.space (via Traefik)
- Port: 3000
- Interface for managing tasks, memory, integrations
CLI
# Helper function (auto-loaded)
openclaw-cli "do something"
# Or directly
docker-compose exec openclaw openclaw "command"
Send message to configured Twilio number → OpenClaw responds and executes
Telegram
Send message to bot (if TELEGRAM_BOT_TOKEN configured)
API
- Endpoint: http://localhost:3001
- Usage:
curl -X POST http://localhost:3001/api/execute \
-H "Content-Type: application/json" \
-d '{"action":"email","to":"user@example.com","subject":"test"}'
Bash Helpers
Auto-added to ~/.bashrc:
# Check which integrations are configured
openclaw-secrets
# Start the service
openclaw-start
# View logs
openclaw-logs
# Execute command via CLI
openclaw-cli "send email to john@example.com saying hello"
Configuration
File: /home/seba/mydocker/openclaw-config.json
Key settings:
ai.provider- Default AI model (claude, gpt, copilot)integrations- Enable/disable services (WhatsApp, Telegram, Gmail, GitHub, etc.)system.sandbox- Run in sandbox mode (safe)system.shellAccess- Allow shell command executionwebUI.port- Web interface port (3000)api.port- REST API port (3001)
AI Models Priority
OpenClaw tries in order:
- Claude (Anthropic) - Recommended, most capable
- GPT-4 (OpenAI) - Alternative
- Copilot (GitHub) - Code-focused
Configure via OPENCLAW_MODEL env var or config file.
Persistent Memory
- Location:
/data/memory(Docker volume) - Survives restarts: Yes
- Clearable:
docker-compose downwon't delete it
Memory stores:
- Your preferences
- Past conversations
- Learned patterns
- Custom skills
Security & Sandbox
⚠️ Important:
- OpenClaw runs with shell access (configurable via
system.shellAccess) - Docker container is sandboxed from host
- API keys stored in environment (not in code)
- Config file mounted read-only
To disable shell access (safer):
Edit openclaw-config.json:
"system": {
"shellAccess": false
}
Then restart:
docker-compose restart openclaw
Skills & Plugins
OpenClaw can:
- Read/write files
- Execute shell commands (if enabled)
- Call APIs (50+ integrations)
- Send emails, messages
- Manage calendars
- Write its own plugins (with safe limits)
Troubleshooting
Check Secrets Are Loaded
openclaw-secrets
View Logs
openclaw-logs
Rebuild Image
docker-compose build --no-cache openclaw
Full Reset (deletes memory)
docker-compose down openclaw
docker volume rm mydocker_openclaw_memory
docker-compose up -d openclaw
Integration Examples
Send Email (via Gmail)
openclaw-cli "send email to boss@company.com subject 'report' body 'attached is...'"
Check Calendar
openclaw-cli "what's on my calendar tomorrow"
Execute Command
openclaw-cli "run git status in /home/seba/project"
GitHub Action
openclaw-cli "create pull request to close issue #123"
Environment Variables
All OpenClaw settings via .env:
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
GITHUB_TOKEN=ghp_...
TWILIO_ACCOUNT_SID=AC...
TWILIO_AUTH_TOKEN=...
TELEGRAM_BOT_TOKEN=...
Docker Commands
# Start
docker-compose up -d openclaw
# Stop
docker-compose stop openclaw
# Restart
docker-compose restart openclaw
# View logs
docker-compose logs -f openclaw
# Shell access
docker-compose exec openclaw /bin/bash
# Delete service (keeps memory/config)
docker-compose down openclaw
# Rebuild
docker-compose build --no-cache openclaw && docker-compose up -d openclaw
Next Steps
- ✅ Add your API keys to
~/.openclaw_secrets - ✅ Run
source ~/.openclaw_secrets - ✅ Start service:
openclaw-start - ✅ Access Web UI: https://openclaw.sebson.space
- ✅ Try CLI:
openclaw-cli "hello" - ✅ Set up WhatsApp/Telegram (optional)
Useful Resources
- GitHub: https://github.com/openclaw/openclaw
- Docs: https://openclaw.ai/docs
- API Docs: https://openclaw.ai/api
Domeny
Web UI
- Domain:
openclaw.sebson.space(dodane do DNS) - Internal:
http://localhost:3000 - Via Traefik:
https://openclaw.sebson.space
API
- Internal:
http://localhost:3007(changed from 3001 to avoid Grafana conflict) - Via Traefik:
https://api.openclaw.sebson.space(optional - requires DNS record)
Port Mapping
Host → Container
3000 → 3000 (Web UI)
3007 → 3001 (API)
Komunikacja
Telegram ✅ (primary)
- Enabled
- Wymaga:
TELEGRAM_BOT_TOKEN,TELEGRAM_CHAT_ID - Bot will respond to messages and execute actions
WhatsApp (placeholder)
- Disabled (ale możesz włączyć)
- Wymaga: Twilio account +
TWILIO_*variables - Jeśli będziesz chcieć - wystarczy zmienić
"enabled": falsenatruew config
CLI ✅ (always available)
openclaw-cli "send message to telegram: hello"