All posts
tutorial|5 min read

OpenClaw Setup Guide: From Zero to AI Assistant in 30 Minutes

Step-by-step guide to setting up OpenClaw, the open-source AI assistant. Self-host on a VPS or use Molty AI for managed hosting. Covers WhatsApp, Telegram, and Discord.

M

Molty Team

Molty by Finna

ShareX

Two Ways to Set Up OpenClaw

OpenClaw is the open-source AI assistant that connects to WhatsApp, Telegram, Discord, and other messaging apps. There are two ways to get it running:

  1. Self-host on your own server (free, more control, more work)
  2. Use Molty AI for managed hosting ($29/month, zero server management)

This guide covers both paths.

Path 1: Self-Hosting OpenClaw

What You Need

  • A server with at least 2GB RAM. This can be a VPS from Hetzner ($5/month), DigitalOcean, Linode, or a spare machine at home.
  • Node.js 20 or newer
  • An API key from Anthropic (Claude) or OpenAI (GPT)

Step 1: Install Node.js

If your server does not have Node.js 20+, install it:

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

Verify with node --version.

Step 2: Install OpenClaw

npm install -g openclaw

This installs the OpenClaw CLI globally. You can also clone the repository from GitHub if you prefer to run from source.

Step 3: Initialize Your Assistant

openclaw init

This creates a configuration directory and walks you through initial setup:

  • Choose your AI model provider (Anthropic, OpenAI, or Ollama for local models)
  • Enter your API key
  • Set a name and personality for your assistant

Step 4: Connect a Messaging Channel

WhatsApp

openclaw channel add whatsapp

A QR code appears in your terminal. Scan it with WhatsApp on your phone (Settings > Linked Devices > Link a Device). Your assistant is now live on WhatsApp.

Telegram

  1. Message @BotFather on Telegram and create a new bot
  2. Copy the bot token
  3. Run:
openclaw channel add telegram --token YOUR_BOT_TOKEN

Discord

  1. Create a bot in the Discord Developer Portal
  2. Copy the bot token
  3. Run:
openclaw channel add discord --token YOUR_BOT_TOKEN
  1. Invite the bot to your server using the OAuth2 URL from the developer portal

Step 5: Start the Service

openclaw gateway

Your assistant is now running. Send it a message on any connected channel and it will respond.

To keep it running in the background:

openclaw gateway --daemon

Or use a process manager like pm2 or systemd.

Keeping OpenClaw Updated

npm update -g openclaw
openclaw gateway --force  # restart with new version

Pin to specific versions in production. Do not run @latest without testing first.

Path 2: Managed Setup with Molty AI

If you would rather skip server management entirely, Molty AI handles everything for you.

Step 1: Sign Up

Create an account on the Molty dashboard. The 3-day trial requires no payment information.

Step 2: Configure Your AI Model

In the dashboard, go to Settings > AI Model and enter your API key:

  • Anthropic Claude - Get a key from console.anthropic.com
  • OpenAI GPT - Get a key from platform.openai.com

Step 3: Connect Channels

Go to Channels in the dashboard and click "Add Channel":

  • WhatsApp: Scan the QR code shown in the dashboard
  • Telegram: Paste your BotFather token
  • Discord: Authorize the bot via OAuth

Step 4: Send a Message

Open the connected messaging app and send a message to your assistant. It responds within seconds.

That is it. No server to manage, no updates to track, no security patches to apply.

Essential Configuration

Whether you self-host or use Molty, these settings are worth configuring early:

System Prompt

The system prompt defines your assistant's personality and behavior. A good starting point:

You are a helpful personal assistant. Be concise and direct. When asked to research something, search the web for current information. When you are unsure about something, say so rather than guessing.

Tool Permissions

OpenClaw assistants can use tools like web search, file management, and browser automation. Review which tools are enabled and disable any you do not need. Fewer tools means less surface area for unexpected behavior.

Scheduled Tasks

Set up your first cron job for a daily briefing:

  • Schedule: 0 7 * * * (every day at 7 AM)
  • Prompt: "Search for today's top 5 tech news stories. Summarize each in 2-3 sentences."
  • Channel: your preferred messaging app

See our guide on replacing newsletters with scheduled tasks for more ideas.

Troubleshooting Common Setup Issues

WhatsApp session keeps disconnecting

WhatsApp Web sessions expire if your phone loses internet or if WhatsApp pushes an update. Re-scan the QR code to reconnect. On the managed Molty platform, the dashboard shows connection status and prompts you to re-scan when needed.

Assistant not responding

Check that the OpenClaw process is running (openclaw status) and that your AI model API key is valid. The most common issue is an expired or rate-limited API key.

Out of memory errors

OpenClaw needs at least 2GB RAM. If your server has less, the process will crash when handling complex requests. Upgrade your VPS or reduce the number of concurrent tools enabled.

Discord bot not appearing in server

Make sure you invited the bot with the correct OAuth2 permissions. The bot needs "Send Messages" and "Read Message History" at minimum. Check the Discord Developer Portal for the correct invite URL.

Next Steps

Once your OpenClaw assistant is running:

Continue reading