
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:latestUsing 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-xxxStart the container:
docker compose up -dConfiguration
Environment Variables
| Variable | Description | Required |
|---|---|---|
ANTHROPIC_API_KEY | Anthropic API key for Claude | Yes* |
OPENAI_API_KEY | OpenAI API key for GPT | Yes* |
GOOGLE_AI_API_KEY | Google API key for Gemini | Yes* |
TELEGRAM_BOT_TOKEN | Telegram bot token | Optional |
DISCORD_BOT_TOKEN | Discord bot token | Optional |
NODE_ENV | Environment (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/dataAdvanced 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/dataHealth 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: 40sResource Limits
Set resource constraints:
services:
moltbot:
image: moltbot/moltbot:latest
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512MUpdating
Update to the latest version:
docker compose pull
docker compose up -dLogs and Debugging
View logs:
# Follow logs
docker compose logs -f moltbot
# Last 100 lines
docker compose logs --tail=100 moltbotBackup 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 /dataTroubleshooting
Container Won't Start
Check logs for errors:
docker compose logs moltbotPermission Errors
Ensure proper ownership:
docker compose exec moltbot chown -R node:node /app/dataNetwork Issues
Verify network connectivity:
docker compose exec moltbot ping api.anthropic.comNeed more help? Join our Discord community or check the GitHub repository.
Categories
More Posts

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

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.

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.
Newsletter
Join the community
Subscribe to our newsletter for the latest news and updates