Self-hosting OpenClaw
Course Material & Reference Guide
Requirements
Minimum specs: 2 cores, 2 GB RAM, 2 GB storage. Ubuntu 24.04 is recommended.
Step 1 — Create a dedicated user
Avoid running everything as root. Create a dedicated openclaw user with sudo privileges and switch into it:
1adduser openclaw --gecos "" && usermod -aG sudo openclaw && su - openclawStep 2 — Run the installer
Install OpenClaw using the one-liner below and enter the new user password when prompted:
1curl -fsSL https://openclaw.ai/install.sh | bashStep 3 — Onboarding wizard
During onboarding, select QuickStart, then choose your AI provider (e.g. Gemini, OpenAI, Anthropic), enter your API key, pick a default model, and select a messaging channel (WhatsApp, Telegram, Discord, Slack, etc.).
If you ever need to re-run setup: openclaw onboard (your saved data/"brain" won't be lost).Step 4 — Useful commands
Some handy management commands once running:
1pnpm openclaw gateway status # Check gateway
2pnpm openclaw gateway restart # Restart gateway
3pnpm openclaw logs # View logs
4pnpm openclaw doctor # Health check
5pnpm openclaw models list # List available modelsOptional — Performance tuning (low-power/ARM VMs)
If CLI commands feel slow on low-power or ARM hosts, enable Node's module compile cache by adding this to ~/.bashrc:
1export NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache
2mkdir -p /var/tmp/openclaw-compile-cache
3export OPENCLAW_NO_RESPAWN=1Security tips
A few best practices: apply least-privilege principles, use short-lived API keys and rotate them regularly, be cautious with openclaw skills install as it's a potential prompt injection vector, and enable automatic Ubuntu security updates with unattended-upgrades.
Supported messaging channels
Telegram (easiest — just register a bot with @BotFather), WhatsApp, Discord, Slack (Socket Mode), Google Chat, Signal, Microsoft Teams, Mattermost, and Nostr are all supported.