Docker Deployment
Docker is the fastest way to get a reproducible Snippbot deployment. This guide covers the complete docker-compose.yml setup, first-run configuration, and ongoing maintenance commands.
Prerequisites
Section titled “Prerequisites”- Docker 24+ and Docker Compose v2 (the
docker composeplugin, not the legacydocker-composebinary) - An Anthropic API key (or other supported provider key)
docker-compose.yml
Section titled “docker-compose.yml”Create a file named docker-compose.yml in a directory of your choice (e.g. ~/snippbot/):
services: snippbot: image: ghcr.io/snippbot/snippbot:latest container_name: snippbot restart: unless-stopped ports: - "18781:18781" - "18790:18790" volumes: - snippbot-data:/root/.snippbot environment: - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} - SNIPPBOT_HOST=0.0.0.0 - SNIPPBOT_PORT=18781 - SNIPPBOT_LOG_LEVEL=info healthcheck: test: ["CMD", "curl", "-f", "http://localhost:18781/health"] interval: 30s timeout: 10s retries: 3 start_period: 15s
volumes: snippbot-data: driver: localEnvironment Variables
Section titled “Environment Variables”Create a .env file in the same directory to hold your secrets:
ANTHROPIC_API_KEY=sk-ant-your-key-hereDocker Compose automatically reads .env from the current directory and substitutes variables in docker-compose.yml.
All Supported Environment Variables
Section titled “All Supported Environment Variables”| Variable | Required | Default | Description |
|---|---|---|---|
ANTHROPIC_API_KEY | Yes* | — | Anthropic API key for Claude models |
OPENAI_API_KEY | No | — | OpenAI API key (if using OpenAI models) |
SNIPPBOT_HOST | No | 127.0.0.1 | Host address to bind the server to; set to 0.0.0.0 inside Docker |
SNIPPBOT_PORT | No | 18781 | Port for the API and UI |
SNIPPBOT_LOG_LEVEL | No | info | Logging verbosity: debug, info, warning, error |
SNIPPBOT_SECRET_KEY | No | auto-generated | Secret key for session signing; set explicitly for multi-instance deployments |
*Required unless another provider key is configured.
Running Snippbot
Section titled “Running Snippbot”-
Start the container
Start in detached mode docker compose up -dDocker pulls the image (first run only) and starts the container. The
-dflag runs it in the background. -
Complete first-run setup
Open your browser and visit:
http://localhost:18781/setupThe setup wizard guides you through:
- Creating your admin account
- Confirming your API key is working
- Creating your first agent
-
Verify the health check
Check container health docker compose psThe
STATUScolumn should showUp (healthy)after about 30 seconds.
Data Persistence
Section titled “Data Persistence”All Snippbot data (the SQLite database, agent workspaces, config files, and uploaded files) is stored in the named volume snippbot-data, which maps to /root/.snippbot inside the container.
To find where Docker stores the volume on your host:
docker volume inspect snippbot_snippbot-dataBacking up data
Section titled “Backing up data”docker run --rm \ -v snippbot_snippbot-data:/data \ -v $(pwd):/backup \ alpine tar czf /backup/snippbot-backup-$(date +%Y%m%d).tar.gz -C /data .Restoring from backup
Section titled “Restoring from backup”docker compose downdocker run --rm \ -v snippbot_snippbot-data:/data \ -v $(pwd):/backup \ alpine sh -c "rm -rf /data/* && tar xzf /backup/snippbot-backup-20260301.tar.gz -C /data"docker compose up -dUpdating Snippbot
Section titled “Updating Snippbot”docker compose pull && docker compose up -dThis downloads the latest image and recreates the container with zero data loss. The snippbot-data volume persists across container recreation.
Useful Commands
Section titled “Useful Commands”View logs
Section titled “View logs”docker compose logs -f snippbotdocker compose logs --tail=100 snippbotOpen a shell inside the container
Section titled “Open a shell inside the container”docker compose exec snippbot bashThis gives you a shell where you can run snippbot CLI commands directly:
snippbot statussnippbot config showStop and remove the container
Section titled “Stop and remove the container”docker compose downdocker compose down -vChannel Adapter in Docker
Section titled “Channel Adapter in Docker”The channel adapter runs as a separate process inside the same container. Port 18790 is already mapped in the docker-compose.yml above. To start the adapter:
docker compose exec snippbot snippbot channel startOr add it as a second service that shares the same data volume:
services: snippbot: image: ghcr.io/snippbot/snippbot:latest # ... (same as above)
snippbot-channels: image: ghcr.io/snippbot/snippbot:latest container_name: snippbot-channels restart: unless-stopped command: ["snippbot", "channel", "start"] ports: - "18790:18790" volumes: - snippbot-data:/root/.snippbot environment: - SNIPPBOT_HOST=0.0.0.0 depends_on: snippbot: condition: service_healthy
volumes: snippbot-data:Putting It Behind a Reverse Proxy
Section titled “Putting It Behind a Reverse Proxy”For production, place Snippbot behind nginx or Caddy to handle HTTPS. See the Reverse Proxy guide for complete configuration examples.
The key change is to not expose port 18781 publicly — let your reverse proxy handle TLS and proxy traffic internally:
ports: - "127.0.0.1:18781:18781" # Only accessible on localhost - "127.0.0.1:18790:18790" # Channel adapter, localhost only