Tools: OpenClaw Setup Guide: From Zero to AI Assistant in 10 Minutes

Tools: OpenClaw Setup Guide: From Zero to AI Assistant in 10 Minutes

Source: Dev.to

Prerequisites ## Step 0: Choose Your Hardware ## Step 1: Prepare Your System ## Step 2: Install OpenClaw ## Step 3: Configure Your AI Provider ## Option A: Anthropic (Claude) ## Option B: OpenAI ## Option C: Local Model (Ollama) ## Step 4: Connect a Messaging Channel ## Telegram Setup (Recommended First Channel) ## WhatsApp Setup ## Discord Setup ## Step 5: Start OpenClaw ## Step 6: Set Up Auto-Start (Keep It Running) ## Step 7: Optional Enhancements ## Browser Automation ## Local Database (Persistent Memory) ## Multiple AI Models ## Troubleshooting Common Issues ## What's Next? ## The 10-Minute Promise You've heard about OpenClaw — the open-source, self-hosted AI assistant that handles Telegram, WhatsApp, Discord, browser automation, and local AI inference. Now you want to set it up. Good news: the OpenClaw setup process is straightforward. I've done it on multiple devices and can walk you through it in about 10 minutes (less if you're on pre-configured hardware). Let's go from zero to a working AI assistant. Before we start, you need: If you haven't picked hardware yet, here's the quick version: The ClawBox comes with OpenClaw pre-installed — if you're using one, skip to Step 5. For everyone else, let's start from scratch. For a detailed hardware comparison, see the best hardware for OpenClaw guide. If you're considering the Mac Mini but want something more affordable and purpose-built, the Mac Mini alternative page breaks down the trade-offs. Start with a fresh Linux install. Ubuntu 22.04/24.04 or Debian 12 are recommended. On a Jetson, use NVIDIA's JetPack OS. Install Node.js 20+ (using nvm is cleanest): Clone the repository and install dependencies: The .env file is where all your configuration lives. Open it in your editor: OpenClaw supports multiple AI backends. Set at least one: If you're on a Jetson (or the ClawBox), local models with GPU acceleration work great. On a Pi or low-end mini PC, stick with cloud APIs. You need at least one channel. Telegram is the easiest to start with. To find your Telegram user ID, message @userinfobot. WhatsApp requires the WhatsApp Business API or a bridge like Baileys: Follow the on-screen QR code pairing process when OpenClaw starts. Create a bot at the Discord Developer Portal: You should see output like: That's it. Message your Telegram bot and you should get a response. You want OpenClaw to survive reboots and crashes. Create a systemd service: Your AI assistant is now running as a system service. It'll auto-start on boot and restart if it crashes. Once the basics work, consider these additions: Install Chromium for web browsing and automation: OpenClaw can now browse the web, fill forms, take screenshots, and automate web tasks on your behalf. By default, OpenClaw uses file-based storage. For better performance with conversation history: You can configure different models for different tasks: "Cannot connect to Telegram" → Check your bot token. Make sure the bot isn't already running elsewhere. "AI provider error" → Verify your API key. Check that you have credits/quota on the provider. "Out of memory" → If on 8GB RAM, reduce the number of concurrent services. Disable browser automation if not needed. "Permission denied" → Make sure your user owns the openclaw directory: sudo chown -R $USER:$USER ~/openclaw Node.js version mismatch → Run nvm use 20 or install the correct version. Once your OpenClaw setup is running: For more detailed configuration options and advanced features, visit the complete OpenClaw setup documentation. If you're on a ClawBox or similar pre-configured device, you literally just plug it in, connect to Wi-Fi, add your API key and bot token, and you're done. Under 10 minutes. On a fresh Linux install, add maybe 15-20 minutes for system prep and Node.js installation. Still faster than setting up most self-hosted applications. The barrier to running your own AI assistant has never been lower. No cloud dependency, no monthly subscription beyond your AI API costs, full control over your data. Welcome to self-hosted AI. It's better over here. Need help choosing hardware? Check the setup guide for hardware-specific instructions, or explore the Mac Mini alternative if you're comparing options. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse COMMAND_BLOCK: # Update your system sudo apt update && sudo apt upgrade -y # Install essential dependencies sudo apt install -y curl git build-essential Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: # Update your system sudo apt update && sudo apt upgrade -y # Install essential dependencies sudo apt install -y curl git build-essential COMMAND_BLOCK: # Update your system sudo apt update && sudo apt upgrade -y # Install essential dependencies sudo apt install -y curl git build-essential COMMAND_BLOCK: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash source ~/.bashrc nvm install 20 nvm use 20 Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash source ~/.bashrc nvm install 20 nvm use 20 COMMAND_BLOCK: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash source ~/.bashrc nvm install 20 nvm use 20 COMMAND_BLOCK: node --version # Should show v20.x.x or higher npm --version # Should show 10.x.x or higher Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: node --version # Should show v20.x.x or higher npm --version # Should show 10.x.x or higher COMMAND_BLOCK: node --version # Should show v20.x.x or higher npm --version # Should show 10.x.x or higher COMMAND_BLOCK: # Clone OpenClaw git clone https://github.com/OpenClaw/openclaw.git cd openclaw # Install dependencies npm install # Copy the example config cp .env.example .env Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: # Clone OpenClaw git clone https://github.com/OpenClaw/openclaw.git cd openclaw # Install dependencies npm install # Copy the example config cp .env.example .env COMMAND_BLOCK: # Clone OpenClaw git clone https://github.com/OpenClaw/openclaw.git cd openclaw # Install dependencies npm install # Copy the example config cp .env.example .env CODE_BLOCK: nano .env Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: ANTHROPIC_API_KEY=sk-ant-your-key-here DEFAULT_MODEL=anthropic/claude-sonnet-4-20250514 Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: ANTHROPIC_API_KEY=sk-ant-your-key-here DEFAULT_MODEL=anthropic/claude-sonnet-4-20250514 CODE_BLOCK: ANTHROPIC_API_KEY=sk-ant-your-key-here DEFAULT_MODEL=anthropic/claude-sonnet-4-20250514 CODE_BLOCK: OPENAI_API_KEY=sk-your-key-here DEFAULT_MODEL=openai/gpt-4o Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: OPENAI_API_KEY=sk-your-key-here DEFAULT_MODEL=openai/gpt-4o CODE_BLOCK: OPENAI_API_KEY=sk-your-key-here DEFAULT_MODEL=openai/gpt-4o CODE_BLOCK: OLLAMA_BASE_URL=http://localhost:11434 DEFAULT_MODEL=ollama/llama3 Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: OLLAMA_BASE_URL=http://localhost:11434 DEFAULT_MODEL=ollama/llama3 CODE_BLOCK: OLLAMA_BASE_URL=http://localhost:11434 DEFAULT_MODEL=ollama/llama3 CODE_BLOCK: TELEGRAM_BOT_TOKEN=your-bot-token-here TELEGRAM_ALLOWED_USERS=your-telegram-user-id Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: TELEGRAM_BOT_TOKEN=your-bot-token-here TELEGRAM_ALLOWED_USERS=your-telegram-user-id CODE_BLOCK: TELEGRAM_BOT_TOKEN=your-bot-token-here TELEGRAM_ALLOWED_USERS=your-telegram-user-id CODE_BLOCK: WHATSAPP_ENABLED=true Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: WHATSAPP_ENABLED=true CODE_BLOCK: WHATSAPP_ENABLED=true CODE_BLOCK: DISCORD_BOT_TOKEN=your-discord-token-here Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: DISCORD_BOT_TOKEN=your-discord-token-here CODE_BLOCK: DISCORD_BOT_TOKEN=your-discord-token-here COMMAND_BLOCK: # Start OpenClaw npm start Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: # Start OpenClaw npm start COMMAND_BLOCK: # Start OpenClaw npm start CODE_BLOCK: ✓ OpenClaw v1.x.x starting... ✓ AI provider connected: anthropic/claude-sonnet-4-20250514 ✓ Telegram bot connected: @YourBotName ✓ Gateway listening on port 3000 ✓ Ready. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: ✓ OpenClaw v1.x.x starting... ✓ AI provider connected: anthropic/claude-sonnet-4-20250514 ✓ Telegram bot connected: @YourBotName ✓ Gateway listening on port 3000 ✓ Ready. CODE_BLOCK: ✓ OpenClaw v1.x.x starting... ✓ AI provider connected: anthropic/claude-sonnet-4-20250514 ✓ Telegram bot connected: @YourBotName ✓ Gateway listening on port 3000 ✓ Ready. COMMAND_BLOCK: sudo nano /etc/systemd/system/openclaw.service Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: sudo nano /etc/systemd/system/openclaw.service COMMAND_BLOCK: sudo nano /etc/systemd/system/openclaw.service CODE_BLOCK: [Unit] Description=OpenClaw AI Assistant After=network.target [Service] Type=simple User=your-username WorkingDirectory=/home/your-username/openclaw ExecStart=/home/your-username/.nvm/versions/node/v20.*/bin/node src/index.js Restart=always RestartSec=10 Environment=NODE_ENV=production [Install] WantedBy=multi-user.target Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: [Unit] Description=OpenClaw AI Assistant After=network.target [Service] Type=simple User=your-username WorkingDirectory=/home/your-username/openclaw ExecStart=/home/your-username/.nvm/versions/node/v20.*/bin/node src/index.js Restart=always RestartSec=10 Environment=NODE_ENV=production [Install] WantedBy=multi-user.target CODE_BLOCK: [Unit] Description=OpenClaw AI Assistant After=network.target [Service] Type=simple User=your-username WorkingDirectory=/home/your-username/openclaw ExecStart=/home/your-username/.nvm/versions/node/v20.*/bin/node src/index.js Restart=always RestartSec=10 Environment=NODE_ENV=production [Install] WantedBy=multi-user.target COMMAND_BLOCK: sudo systemctl daemon-reload sudo systemctl enable openclaw sudo systemctl start openclaw Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: sudo systemctl daemon-reload sudo systemctl enable openclaw sudo systemctl start openclaw COMMAND_BLOCK: sudo systemctl daemon-reload sudo systemctl enable openclaw sudo systemctl start openclaw COMMAND_BLOCK: sudo systemctl status openclaw Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: sudo systemctl status openclaw COMMAND_BLOCK: sudo systemctl status openclaw COMMAND_BLOCK: sudo apt install -y chromium-browser Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: sudo apt install -y chromium-browser COMMAND_BLOCK: sudo apt install -y chromium-browser CODE_BLOCK: BROWSER_ENABLED=true Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: BROWSER_ENABLED=true CODE_BLOCK: BROWSER_ENABLED=true COMMAND_BLOCK: sudo apt install -y postgresql sudo -u postgres createuser openclaw sudo -u postgres createdb openclaw -O openclaw Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: sudo apt install -y postgresql sudo -u postgres createuser openclaw sudo -u postgres createdb openclaw -O openclaw COMMAND_BLOCK: sudo apt install -y postgresql sudo -u postgres createuser openclaw sudo -u postgres createdb openclaw -O openclaw CODE_BLOCK: DATABASE_URL=postgresql://openclaw@localhost/openclaw Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: DATABASE_URL=postgresql://openclaw@localhost/openclaw CODE_BLOCK: DATABASE_URL=postgresql://openclaw@localhost/openclaw CODE_BLOCK: DEFAULT_MODEL=anthropic/claude-sonnet-4-20250514 THINKING_MODEL=anthropic/claude-opus-4-6 FAST_MODEL=anthropic/claude-haiku-3 Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: DEFAULT_MODEL=anthropic/claude-sonnet-4-20250514 THINKING_MODEL=anthropic/claude-opus-4-6 FAST_MODEL=anthropic/claude-haiku-3 CODE_BLOCK: DEFAULT_MODEL=anthropic/claude-sonnet-4-20250514 THINKING_MODEL=anthropic/claude-opus-4-6 FAST_MODEL=anthropic/claude-haiku-3 - Hardware — any always-on Linux machine (more on this below) - Node.js 20+ — OpenClaw's runtime - At least one messaging account — Telegram bot token, WhatsApp, or Discord bot - An AI API key — OpenAI, Anthropic, or a local model endpoint - 10 minutes of your time - Open Telegram and message @BotFather - Send /newbot and follow the prompts - Copy the bot token - Explore the workspace — OpenClaw has a file-based memory system. Check the workspace/ folder. - Add more channels — Connect WhatsApp, Discord, or email. - Customize your assistant — Edit SOUL.md to define your AI's personality and behavior. - Set up cron jobs — Automate recurring tasks like email checks or calendar reminders. - Browse the community — Join the OpenClaw Discord/GitHub discussions for tips and integrations.