DEV Community

Cover image for How to Install Moltbot with Docker and Gemini on WSL
Nunc
Nunc

Posted on

How to Install Moltbot with Docker and Gemini on WSL

Ever wanted your own AI assistant that you can chat with via WhatsApp? Meet Moltbot - an open-source AI gateway that just went through a rebrand with an interesting backstory.

The Name Change Story

You might have heard of "Clawdbot" - a popular AI assistant project with a space lobster mascot. On January 27, 2026, Anthropic sent a trademark request because "Clawd" was too similar to their "Claude" trademark.

Creator Peter Steinberger (@steipete) took it in stride:

"Anthropic asked us to change our name (trademark stuff), and honestly? 'Molt' fits perfectly - it's what lobsters do to grow."

The mascot is now "Molty" and the project is "Moltbot". Sometimes forced changes lead to better names.

Why Gemini Instead of Claude?

You might wonder: "I have a Claude Code subscription, why not use that?"

Here's the problem: Anthropic actively blocks third-party tools from using Claude Code subscriptions, and doing so violates their Terms of Service.

In early January 2026, Anthropic cracked down on "harnesses" - third-party tools that use Claude Code OAuth to access consumer subscriptions. An Anthropic employee explained:

"Restrictions target third-party harnesses spoofing the official client, which violate ToS by creating unusual traffic patterns without telemetry — complicating debugging, rate limits, and support."

The risks of using Claude Code subscription with Moltbot:

Risk Details
Account ban Anthropic has banned users for TOS violations
Sudden disconnection Your bot stops working without warning
Gray area legally Operating outside official support

The error you'll see: "This credential is only authorized for use with Claude Code and cannot be used for other API requests."

The safe alternatives:

  • Gemini CLI (this guide) - Free tier, legitimate OAuth
  • Anthropic API key - Pay-as-you-go, officially supported
  • Google Antigravity - Access Claude via Google's infrastructure

This guide uses Gemini because it's free, has generous limits, and Google actively supports third-party integrations.

What You'll Build

By the end of this guide, you'll have:

  • Moltbot running in Docker on WSL
  • Google Gemini as your AI backend (free tier available)
  • Optional WhatsApp integration to chat with your bot

Prerequisites

  • Windows with WSL 2 (Ubuntu 22.04)
  • An internet connection
  • About 30 minutes

Step 1: Install Docker in WSL

Open your WSL terminal and run:

# Update and install dependencies
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg

# Add Docker's GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install Docker Engine
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Add yourself to docker group
sudo usermod -aG docker $USER
sudo service docker start
Enter fullscreen mode Exit fullscreen mode

Important: Log out of WSL and back in for the group change to work:

exit
# Reopen WSL, then verify:
docker run hello-world
Enter fullscreen mode Exit fullscreen mode

Step 2: Clone and Build Moltbot

mkdir -p ~/GIT/moltbot-project
cd ~/GIT/moltbot-project
git clone https://github.com/moltbot/moltbot.git
cd moltbot
./docker-setup.sh
Enter fullscreen mode Exit fullscreen mode

During setup, use these quick settings:

Prompt Value
Security warning Yes
Onboarding mode QuickStart
Model/auth provider Skip for now
Gateway bind lan
Gateway auth token

Step 3: Add Gemini Support

Create a custom Dockerfile that includes Gemini CLI:

cd ~/GIT/moltbot-project

cat > Dockerfile.custom << 'EOF'
FROM moltbot:local
USER root
RUN npm install -g @google/gemini-cli
USER node
VOLUME /home/node/.gemini
EOF

docker build -t moltbot-with-gemini -f Dockerfile.custom .
Enter fullscreen mode Exit fullscreen mode

Step 4: Authenticate with Gemini

Install and authenticate Gemini CLI in WSL:

npm install -g @google/gemini-cli
gemini
Enter fullscreen mode Exit fullscreen mode

Follow the OAuth flow in your browser. This creates credentials in ~/.gemini/.

Step 5: Wire It All Together

Create a Docker Compose override to mount your Gemini credentials:

cat > ~/GIT/moltbot-project/moltbot/docker-compose.override.yml << 'EOF'
services:
  moltbot-gateway:
    image: moltbot-with-gemini
    environment:
      HOME: /home/node
    volumes:
      - ~/.gemini:/home/node/.gemini
      - ~/.clawdbot:/home/node/.moltbot
  moltbot-cli:
    image: moltbot-with-gemini
    environment:
      HOME: /home/node
    volumes:
      - ~/.gemini:/home/node/.gemini
      - ~/.clawdbot:/home/node/.moltbot
EOF
Enter fullscreen mode Exit fullscreen mode

Enable the Gemini plugin:

cd ~/GIT/moltbot-project/moltbot

# Enable plugin
docker compose -f docker-compose.yml -f docker-compose.override.yml run -it --rm moltbot-cli plugins enable google-gemini-cli-auth

# Authenticate inside container
docker compose -f docker-compose.yml -f docker-compose.override.yml run -it --rm moltbot-cli auth login --provider google-gemini-cli

# Configure models
docker compose -f docker-compose.yml -f docker-compose.override.yml run -it --rm moltbot-cli configure
Enter fullscreen mode Exit fullscreen mode

Step 6: Start and Test

# Start the gateway
docker compose -f docker-compose.yml -f docker-compose.override.yml up -d moltbot-gateway

# Test it
docker compose -f docker-compose.yml -f docker-compose.override.yml run -it --rm moltbot-cli agent --local --session-id test -m "Hello!"
Enter fullscreen mode Exit fullscreen mode

You should get a response from your AI.

Bonus: Add WhatsApp

WhatsApp is surprisingly easy - it uses QR code login like WhatsApp Web.

# Configure WhatsApp channel
docker compose -f docker-compose.yml -f docker-compose.override.yml run -it --rm moltbot-cli configure
Enter fullscreen mode Exit fullscreen mode

Select Channels -> WhatsApp and set:

  • Personal phone mode: Yes
  • dmPolicy: allowlist
  • allowFrom: Your phone number (e.g., +15551234567)

Then link your phone:

docker compose -f docker-compose.yml -f docker-compose.override.yml run -it --rm moltbot-cli channels login
Enter fullscreen mode Exit fullscreen mode

Scan the QR code with WhatsApp (Settings -> Linked Devices -> Link a Device). Now you can chat with your AI via WhatsApp self-messages.

Quick Reference Commands

cd ~/GIT/moltbot-project/moltbot

# Start
docker compose -f docker-compose.yml -f docker-compose.override.yml up -d moltbot-gateway

# Stop
docker compose -f docker-compose.yml -f docker-compose.override.yml down

# View logs
docker compose -f docker-compose.yml -f docker-compose.override.yml logs -f moltbot-gateway

# Open dashboard
docker compose -f docker-compose.yml -f docker-compose.override.yml run --rm moltbot-cli dashboard
Enter fullscreen mode Exit fullscreen mode

Troubleshooting

Docker permission denied?

sudo usermod -aG docker $USER
# Then log out and back in
Enter fullscreen mode Exit fullscreen mode

Gemini rate limits (429)?
The free tier has limits. Wait a bit or add an API key fallback from Google AI Studio.

Config files owned by root?

sudo chown -R $USER:$USER ~/.clawdbot
Enter fullscreen mode Exit fullscreen mode

Wrapping Up

Moltbot gives you a self-hosted AI gateway that can connect to various backends (Gemini, Claude via Antigravity, etc.) and channels (WhatsApp, Discord, Telegram). The Docker setup keeps everything contained and reproducible.

The rebrand from Clawdbot to Moltbot is a good reminder that sometimes external pressure leads to better outcomes - "Molt" really does fit the lobster theme better.


Have you set up Moltbot or a similar AI assistant? Share your experience in the comments!

Top comments (0)