🐳
Recommended

Clawdbot with Docker

Docker is the recommended way to run Clawdbot. Get up and running in under 3 minutes with a consistent, isolated environment.

Why Docker?

Isolated Environment

Clawdbot runs in its own container, not affecting your system

Easy Updates

Pull the latest image and restart to update

Consistent

Same experience on any operating system

Simple Cleanup

Remove the container to completely uninstall

Prerequisites

Install Docker

🐧 Linux

curl -fsSL https://get.docker.com | sh

Installation Steps

1
Clone the Repository

git clone https://github.com/clawdbot/clawdbot.git

cd clawdbot

2
Configure Environment Variables

Copy the example environment file and add your API keys:

cp .env.example .env

Edit the .env file with your favorite editor:

# Required: AI Provider API Key

ANTHROPIC_API_KEY=sk-ant-your-key-here

# Required: Telegram Bot Token

TELEGRAM_BOT_TOKEN=1234567890:ABC-your-token

# Optional: Other providers

OPENAI_API_KEY=sk-your-openai-key

# Optional: Model selection

DEFAULT_MODEL=claude-3-5-sonnet-20241022

3
Start with Docker Compose

docker compose up -d

This will pull the Docker image and start Clawdbot in the background.

4
Verify It's Running

# Check container status

docker compose ps

# View logs

docker compose logs -f

Open Telegram and send a message to your bot. You should get a response!

Common Commands

Start/Stop

# Start

docker compose up -d

# Stop

docker compose down

# Restart

docker compose restart

View Logs

# Follow logs

docker compose logs -f

# Last 100 lines

docker compose logs --tail=100

Update

# Pull latest & restart

git pull

docker compose pull

docker compose up -d

Cleanup

# Remove everything

docker compose down -v

# Remove images too

docker compose down -v --rmi all

Understanding docker-compose.yml

version: '3.8'

services:
  clawdbot:
    image: clawdbot/clawdbot:latest
    container_name: clawdbot
    restart: unless-stopped
    env_file:
      - .env
    volumes:
      - ./data:/app/data
    # Optional: expose port for web interface
    # ports:
    #   - "3000:3000"

restart: unless-stopped - Auto-restart on crash or reboot

env_file - Load environment variables from .env

volumes - Persist data across container restarts

Troubleshooting

Container exits immediately

Check the logs for error messages:

docker compose logs

Common causes: missing API keys, invalid token format, or syntax errors in .env file.

Permission denied errors

On Linux, add your user to the docker group: sudo usermod -aG docker $USER then log out and back in.

Can't connect to Docker daemon

Make sure Docker Desktop is running (macOS/Windows) or the Docker service is started (Linux): sudo systemctl start docker