Discord Docker Deployment
PocketPaw ships with a dedicated Discord deployment setup in deploy/discord/. This runs the bot headless (no web dashboard) in a lightweight container with all agent backends and tools pre-installed.
Quick Start
cd deploy/discordcp .env.example .env# Edit .env with your bot token and LLM providerdocker compose up -dThis deployment runs pocketpaw --discord in headless mode. For the full web dashboard with Discord as one of many channels, use the main Docker deployment instead.
LLM Provider Options
The .env.example file includes six provider options. Uncomment the one that fits your setup.
Route through a LiteLLM proxy to access 100+ providers (Anthropic, OpenAI, Azure, Bedrock, etc.) via a single endpoint:
POCKETPAW_AGENT_BACKEND=claude_agent_sdkPOCKETPAW_CLAUDE_SDK_PROVIDER=litellmPOCKETPAW_LITELLM_API_BASE=http://host.docker.internal:4000POCKETPAW_LITELLM_API_KEY=your-litellm-master-keyPOCKETPAW_LITELLM_MODEL=anthropic/claude-sonnet-4-6Use host.docker.internal to reach a LiteLLM instance running on the host machine.
Direct Anthropic API access with your own API key:
POCKETPAW_AGENT_BACKEND=claude_agent_sdkPOCKETPAW_CLAUDE_SDK_PROVIDER=anthropicPOCKETPAW_ANTHROPIC_API_KEY=sk-ant-...Use your Claude Max or Pro plan without a separate API key. Generate a long-lived OAuth token (~1 year) on your local machine, then paste it into the env file. No volume mount needed.
# On your local machine first:claude setup-token
# Then in .env:POCKETPAW_AGENT_BACKEND=claude_agent_sdkPOCKETPAW_CLAUDE_SDK_PROVIDER=claude_codePOCKETPAW_CLAUDE_CODE_OAUTH_TOKEN={"accessToken":"sk-ant-oat01-...","refreshToken":"sk-ant-ort01-...","expiresAt":"2027-..."}This is the easiest option for Coolify and remote servers. No interactive login needed after the initial token generation.
Interactive OAuth login persisted in a Docker volume. Requires a one-time login inside the container:
POCKETPAW_AGENT_BACKEND=claude_agent_sdkPOCKETPAW_CLAUDE_SDK_PROVIDER=claude_codeFirst-time setup:
- Deploy with these settings
- Exec into the container:
docker exec -it pocketpaw-discord bash - Run
claudeand complete the OAuth login in your browser - Exit and restart the container
On Coolify, use the “Execute Command” feature in the container terminal.
The claude-auth volume persists your login across container restarts and redeployments.
Connect to any OpenAI-compatible endpoint (vLLM, Ollama, local servers):
POCKETPAW_AGENT_BACKEND=claude_agent_sdkPOCKETPAW_CLAUDE_SDK_PROVIDER=openai_compatiblePOCKETPAW_OPENAI_COMPATIBLE_BASE_URL=http://host.docker.internal:8080/v1POCKETPAW_OPENAI_COMPATIBLE_API_KEY=your-api-keyPOCKETPAW_OPENAI_COMPATIBLE_MODEL=your-modelUse the OpenAI Agents backend with LiteLLM:
POCKETPAW_AGENT_BACKEND=openai_agentsPOCKETPAW_OPENAI_AGENTS_PROVIDER=litellmPOCKETPAW_LITELLM_API_BASE=http://host.docker.internal:4000POCKETPAW_LITELLM_API_KEY=your-litellm-master-keyPOCKETPAW_LITELLM_MODEL=openai/gpt-5.2Dockerfile
The Discord Dockerfile uses a multi-stage build optimized for headless operation (no Playwright/Chromium):
Node stage (node:22-slim):
- Installs Claude Code CLI and Codex CLI globally
Builder stage (python:3.12-slim):
- Creates a virtual environment and installs
pocketpaw[all]
Runtime stage (python:3.12-slim):
- Copies Node.js, CLI tools, and the Python venv
- Installs only runtime deps (git, tesseract)
- Creates a non-root
pocketpawuser - Pre-creates
~/.claude.jsonmarker file (prevents Claude Code onboarding prompt) - Runs
pocketpaw --discordas the entrypoint
The Discord image is significantly smaller than the main Docker image because it skips Playwright and Chromium shared libraries.
Docker Compose
The docker-compose.yaml defines a single pocketpaw-discord service with four volume mounts:
volumes: # PocketPaw config, memory, sessions, audit logs - pocketpaw-discord-data:/home/pocketpaw/.pocketpaw
# Custom identity / system prompt (optional) - ./identity:/home/pocketpaw/.pocketpaw/identity
# Agent-created files (accessible on the host) - ./workspace:/home/pocketpaw/workspace
# Claude Code OAuth credentials - claude-auth:/home/pocketpaw/.claudeClaude Auth Volume
The claude-auth volume stores Claude Code OAuth credentials. Two options:
Named volume (for Coolify and remote servers):
- claude-auth:/home/pocketpaw/.claudeExec into the container once to run claude and complete the login, or use the OAuth token approach.
Host bind mount (reuse your local Claude Code login):
- ${CLAUDE_CONFIG_DIR:-~/.claude}:/home/pocketpaw/.claudeResource Limits
The compose file sets resource limits to prevent runaway usage:
| Resource | Limit | Reservation |
|---|---|---|
| Memory | 8 GB | 2 GB |
| CPUs | 4 | 2 |
Adjust these in the deploy.resources section based on your server.
Discord Configuration
Required
POCKETPAW_DISCORD_BOT_TOKEN=your-bot-token-hereAccess Control
# Lock to specific serversPOCKETPAW_DISCORD_ALLOWED_GUILD_IDS=[123456789012345678]
# Restrict to specific channelsPOCKETPAW_DISCORD_ALLOWED_CHANNEL_IDS=[123456789012345678]
# Restrict to specific usersPOCKETPAW_DISCORD_ALLOWED_USER_IDS=[123456789012345678]Server-Wide Conversation Mode
Enable conversation mode across all channels without needing the /converse command:
POCKETPAW_DISCORD_CONVERSATION_ALL_CHANNELS=true
# Exclude channels like announcements or rulesPOCKETPAW_DISCORD_CONVERSATION_EXCLUDE_CHANNEL_IDS=[123456789,987654321]Bot Presence
POCKETPAW_DISCORD_BOT_NAME=CodeReviewerPOCKETPAW_DISCORD_STATUS_TYPE=online # online, idle, dnd, invisiblePOCKETPAW_DISCORD_ACTIVITY_TYPE=watching # playing, streaming, listening, watchingPOCKETPAW_DISCORD_ACTIVITY_TEXT=your codeSoul (Persistent Identity)
Give your bot a persistent personality that evolves over time:
POCKETPAW_SOUL_ENABLED=truePOCKETPAW_SOUL_NAME=PawPOCKETPAW_SOUL_ARCHETYPE=The Helpful AssistantPOCKETPAW_SOUL_AUTO_SAVE_INTERVAL=300Managing the Container
# View logsdocker compose logs -f pocketpaw-discord
# Restartdocker compose restart pocketpaw-discord
# Stopdocker compose down
# Rebuild after updatesdocker compose build && docker compose up -dCoolify Deployment
For Coolify users:
- Point to the
deploy/discord/directory in your repo - Set the Dockerfile path to
deploy/discord/Dockerfileand build context to the repo root - Add all env vars from
.env.examplein the Coolify environment settings - For Claude Code auth, use the OAuth token option (
POCKETPAW_CLAUDE_CODE_OAUTH_TOKEN) to avoid interactive login, or use the container terminal to runclaudeonce
Related
Discord Bot Setup
Full Discord feature reference: slash commands, conversation mode, MCP server.
Main Docker Deployment
Full-stack Docker setup with web dashboard, Ollama, and Qdrant profiles.
Discord AI Bot Guide
Step-by-step tutorial for adding an AI assistant to your Discord server.
Self-Hosting
Reverse proxy, SSL, and production hardening.