Getting Started with Moltbot - Setup Guide

Jan 28, 2025

Getting Started with Moltbot - Complete Setup Guide

Moltbot is a self-hosted AI gateway that connects your favorite messaging platforms to powerful AI models. In this guide, we'll walk through the installation and initial configuration process.

What You'll Need

Before getting started, make sure you have:

  1. Node.js 22 or higher - Check your version with node -v
  2. npm or pnpm - Package manager for managing dependencies
  3. API Key - From an AI provider (Anthropic Claude, OpenAI, etc.)
  4. Messaging Platform Account - WhatsApp, Telegram, Discord, or others
  5. A server or computer - To run Moltbot (Mac, Linux, or Windows)

Step 1: Install Moltbot

The easiest way to install Moltbot is through npm:

npm install -g moltbot@latest

Verify the installation:

moltbot --version

Step 2: Run the Setup Wizard

Launch the interactive setup wizard:

moltbot onboard --install-daemon

This will guide you through:

  1. Selecting a messaging platform - Choose from WhatsApp, Telegram, Discord, iMessage, Slack, etc.
  2. Choosing an AI provider - Select Claude, ChatGPT, Gemini, or others
  3. Entering API credentials - Your API keys for the AI service
  4. Configuring messaging authentication - Bot tokens or connection details
  5. Setting up local preferences - Model parameters, response styles, etc.

Step 3: Connect Your AI Provider

  1. Get an API key from console.anthropic.com
  2. During setup, select "Anthropic" as your AI provider
  3. Enter your API key when prompted
  4. Test the connection

Using OpenAI ChatGPT

  1. Get an API key from platform.openai.com
  2. Select "OpenAI" during setup
  3. Enter your API key and preferred model (gpt-4, gpt-3.5-turbo, etc.)

Step 4: Configure Your Messaging Platform

Setting up Telegram

  1. Create a bot with BotFather on Telegram
  2. Get your bot token
  3. Configure the webhook URL that Moltbot provides
  4. Test by messaging your bot

Setting up WhatsApp

  1. Create a business account
  2. Generate QR code for scanning (or use phone verification)
  3. Connect your business phone number
  4. Start chatting with your bot

Step 5: Test Your Setup

Once configured, test Moltbot:

# Start Moltbot
moltbot gateway

# In another terminal, send a test message
# to your bot on your chosen platform

You should get an AI response within a few seconds!

Common Setup Issues

Issue: "Cannot find module moltbot"

  • Make sure you installed it globally: npm install -g moltbot@latest
  • Check Node.js is installed: node --version

Issue: API key not working

  • Verify the key is valid and not expired
  • Check you're using the correct AI provider
  • Ensure the key has the necessary permissions

Issue: Messaging platform not responding

  • Verify bot tokens/credentials are correct
  • Check webhook URLs are properly configured
  • Ensure your bot has necessary permissions

Next Steps

  1. Configure multiple AI agents for different purposes
  2. Set up group chat support to use the bot in conversations
  3. Enable media handling for images, voice notes, etc.
  4. Configure cron jobs for automated tasks
  5. Join the community for tips and tricks

Resources

Happy messaging with Moltbot! 🦞

Moltbot Community

Moltbot Community

Getting Started with Moltbot - Setup Guide | Blog