Overview
Running the proxy in Docker provides several benefits:- Persistent service — Automatic restart on system reboot
- Isolated environment — Runs independently of your system Node.js version
- Easy management — Start, stop, and monitor with docker commands
- Zero dependencies — No need to install Node.js packages
Docker is optional. You can run the proxy directly with Node.js if preferred.
Prerequisites
- Docker Engine 20.10+ or Docker Desktop
- Docker Compose v2.0+ (usually bundled with Docker Desktop)
- Completed GitHub authentication (see Authentication)
Docker configuration
The project includes a complete Docker setup with minimal configuration:Dockerfile
The Dockerfile uses Node.js 22 Alpine for a lightweight image:Dockerfile
- Alpine Linux — Minimal base image (~50MB)
- Node.js 22 — Latest LTS runtime
- Single script — Only copies the proxy server
- Port 18080 — Default proxy port exposed
docker-compose.yml
The compose file configures the proxy service with automatic restarts:docker-compose.yml
restart: always
restart: always
Ensures the container automatically restarts:
- When it crashes or exits
- When Docker daemon restarts
- After system reboots
Port mapping
Port mapping
http://localhost:18080.Volume mount
Volume mount
- Source:
~/.claude-copilot-auth.json(your host machine) - Target:
/root/.claude-copilot-auth.json(inside container) - Mode:
ro(read-only for security)
Environment variables
Environment variables
COPILOT_PROXY_PORT— Port the proxy listens onBRAVE_API_KEY— Optional Brave Search API key (reads from host environment)WEB_SEARCH_MAX_RESULTS— Max search results (default: 5)
Deployment steps
Authenticate with GitHub
Before starting Docker, you must authenticate:This creates
~/.claude-copilot-auth.json which Docker will mount.Start the container
Build and start the proxy in detached mode:Options explained:
up— Create and start containers-d— Detached mode (run in background)--build— Rebuild image if Dockerfile changed
The proxy is now running and will automatically restart after system reboots!
Container management
View logs
Monitor proxy server logs in real-time:Stop the container
Stop without removing:Restart the container
Restart after configuration changes:Update and rebuild
When you update the proxy script:Environment variable injection
Pass environment variables from your host to the container:Using .env file
Create a.env file in the project root:
.env
.env files.
Using command line
Pass variables inline:Using export
Export to your shell environment:Custom port configuration
Change the proxy port by modifying both the environment variable and port mapping:docker-compose.yml
Troubleshooting
Container fails to start
Container fails to start
Check logs for errors:Common issues:
- Missing auth file: Run
node scripts/auth.mjsfirst - Port already in use: Change the port in docker-compose.yml
- Permission denied: Ensure Docker daemon is running
Port 18080 already in use
Port 18080 already in use
Find what’s using the port:Kill the process:Or change the port in docker-compose.yml.
Auth file not found in container
Auth file not found in container
Verify the auth file exists on your host:If missing, run authentication:Then restart the container:
Container doesn't restart after reboot
Container doesn't restart after reboot
Check the restart policy:Should show:Ensure Docker daemon starts on boot (usually automatic with Docker Desktop).
Alternative: Launch script
The project includesscripts/launch.sh which automatically handles Docker setup:
scripts/launch.sh
- Detects if Docker is available
- Starts the proxy via Docker (or falls back to Node.js)
- Automatically launches Claude Code
Running without Docker
If you prefer not to use Docker, run the proxy directly with Node.js:- systemd service (Linux)
- launchd (macOS)
- pm2 (cross-platform process manager)
PM2 example
Install PM2:Next steps
Configuration
Configure web search, model selection, and advanced options
Troubleshooting
Resolve common issues and errors