LogoOpenClawAI
  • Features
  • Get Started
  • Blog
Install MoltBot with Docker - Complete Deployment Guide
2026/01/30

Install MoltBot with Docker - Complete Deployment Guide

Step-by-step guide to deploy MoltBot using Docker and Docker Compose. Run your personal AI assistant in containers.

Deploy MoltBot with Docker

Docker is the recommended way to run MoltBot in production. This guide covers everything from basic setup to advanced configurations.

Prerequisites

  • Docker 20.10+
  • Docker Compose v2+
  • API key for your AI model (Claude, GPT, or Gemini)

Quick Start

Using Docker Run

The fastest way to start MoltBot:

docker run -d \
  --name moltbot \
  -e ANTHROPIC_API_KEY=your_key_here \
  -v moltbot_data:/app/data \
  -p 3000:3000 \
  moltbot/moltbot:latest

Using Docker Compose

Create a docker-compose.yml file:

version: '3.8'

services:
  moltbot:
    image: moltbot/moltbot:latest
    container_name: moltbot
    restart: unless-stopped
    environment:
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
      - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
      - NODE_ENV=production
    volumes:
      - moltbot_data:/app/data
      - ./config:/app/config
    ports:
      - "3000:3000"

volumes:
  moltbot_data:

Create a .env file:

ANTHROPIC_API_KEY=sk-ant-xxx
TELEGRAM_BOT_TOKEN=123456:ABC-xxx

Start the container:

docker compose up -d

Configuration

Environment Variables

VariableDescriptionRequired
ANTHROPIC_API_KEYAnthropic API key for ClaudeYes*
OPENAI_API_KEYOpenAI API key for GPTYes*
GOOGLE_AI_API_KEYGoogle API key for GeminiYes*
TELEGRAM_BOT_TOKENTelegram bot tokenOptional
DISCORD_BOT_TOKENDiscord bot tokenOptional
NODE_ENVEnvironment (production/development)Recommended

*At least one AI provider key is required.

Persistent Data

MoltBot stores data in /app/data:

  • Memory: Conversation history and context
  • Config: User preferences and settings
  • Skills: Custom skill configurations

Always mount a volume for persistence:

volumes:
  - moltbot_data:/app/data

Advanced Configurations

With Redis for Sessions

version: '3.8'

services:
  moltbot:
    image: moltbot/moltbot:latest
    environment:
      - REDIS_URL=redis://redis:6379
    depends_on:
      - redis
    # ... other config

  redis:
    image: redis:alpine
    volumes:
      - redis_data:/data

volumes:
  moltbot_data:
  redis_data:

With PostgreSQL for Memory

version: '3.8'

services:
  moltbot:
    image: moltbot/moltbot:latest
    environment:
      - DATABASE_URL=postgresql://user:pass@postgres:5432/moltbot
    depends_on:
      - postgres
    # ... other config

  postgres:
    image: postgres:15-alpine
    environment:
      - POSTGRES_USER=user
      - POSTGRES_PASSWORD=pass
      - POSTGRES_DB=moltbot
    volumes:
      - postgres_data:/var/lib/postgresql/data

volumes:
  moltbot_data:
  postgres_data:

Multi-Platform Messaging

Enable multiple messaging platforms:

services:
  moltbot:
    image: moltbot/moltbot:latest
    environment:
      # AI Provider
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}

      # Messaging Platforms
      - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
      - DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN}
      - SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN}
      - WHATSAPP_SESSION_PATH=/app/data/whatsapp
    volumes:
      - moltbot_data:/app/data

Health Checks

Add health check configuration:

services:
  moltbot:
    image: moltbot/moltbot:latest
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

Resource Limits

Set resource constraints:

services:
  moltbot:
    image: moltbot/moltbot:latest
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: 2G
        reservations:
          cpus: '0.5'
          memory: 512M

Updating

Update to the latest version:

docker compose pull
docker compose up -d

Logs and Debugging

View logs:

# Follow logs
docker compose logs -f moltbot

# Last 100 lines
docker compose logs --tail=100 moltbot

Backup and Restore

Backup Data

docker run --rm \
  -v moltbot_data:/data \
  -v $(pwd):/backup \
  alpine tar czf /backup/moltbot-backup.tar.gz -C /data .

Restore Data

docker run --rm \
  -v moltbot_data:/data \
  -v $(pwd):/backup \
  alpine tar xzf /backup/moltbot-backup.tar.gz -C /data

Troubleshooting

Container Won't Start

Check logs for errors:

docker compose logs moltbot

Permission Errors

Ensure proper ownership:

docker compose exec moltbot chown -R node:node /app/data

Network Issues

Verify network connectivity:

docker compose exec moltbot ping api.anthropic.com

Need more help? Join our Discord community or check the GitHub repository.

All Posts

Categories

    Deploy MoltBot with DockerPrerequisitesQuick StartUsing Docker RunUsing Docker ComposeConfigurationEnvironment VariablesPersistent DataAdvanced ConfigurationsWith Redis for SessionsWith PostgreSQL for MemoryMulti-Platform MessagingHealth ChecksResource LimitsUpdatingLogs and DebuggingBackup and RestoreBackup DataRestore DataTroubleshootingContainer Won't StartPermission ErrorsNetwork Issues

    More Posts

    MoltBot with Ollama - Run Local AI Models

    MoltBot with Ollama - Run Local AI Models

    Use Ollama with MoltBot for private, offline AI. Local LLM setup guide for complete privacy and control.

    2026/01/30
    What is MoltBot AI? Your Open-Source Personal AI Assistant

    What is MoltBot AI? Your Open-Source Personal AI Assistant

    Discover MoltBot AI, the open-source personal AI assistant that actually does things. Learn about its features, capabilities, and how it can automate your daily tasks.

    2026/01/30
    MoltBot GitHub - Source Code, Installation & Contributing Guide

    MoltBot GitHub - Source Code, Installation & Contributing Guide

    Official MoltBot GitHub repository. Clone, install from source, and contribute to the open source project. Complete guide to MoltBot GitHub.

    2026/01/30

    Newsletter

    Join the community

    Subscribe to our newsletter for the latest news and updates

    LogoOpenClawAI

    The AI that actually does things. Open-source personal AI assistant.

    GitHubGitHubEmail
    Product
    • Features
    • FAQ
    Resources
    • Blog
    Company
    • About
    • Contact
    Legal
    • Cookie Policy
    • Privacy Policy
    • Terms of Service
    Š 2026 OpenClawAI All Rights Reserved.