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
🍎 macOS
Docker Desktop for Mac →🪟 Windows
Docker Desktop for Windows →🐧 Linux
Installation Steps
git clone https://github.com/clawdbot/clawdbot.git
cd clawdbot
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
docker compose up -d
This will pull the Docker image and start Clawdbot in the background.
# 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
docker compose up -d
# Stop
docker compose down
# Restart
docker compose restart
# Follow logs
docker compose logs -f
# Last 100 lines
docker compose logs --tail=100
# Pull latest & restart
git pull
docker compose pull
docker compose up -d
# 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
Check the logs for error messages:
Common causes: missing API keys, invalid token format, or syntax errors in .env file.
On Linux, add your user to the docker group: sudo usermod -aG docker $USER then log out and back in.
Make sure Docker Desktop is running (macOS/Windows) or the Docker service is started (Linux): sudo systemctl start docker