Skip to main content

Overview

Docker deployment allows you to:
  • Isolated environment - Run CCS Dashboard in a container with all dependencies
  • Persistent configuration - Keep your config, credentials, and CLI tools across restarts
  • Resource limits - Control memory and CPU usage for production deployments
  • Easy deployment - Deploy to any system with Docker installed
  • Pre-installed CLIs - claude, gemini, grok, opencode, and ccs ready to use

Architecture

Prerequisites

  • Docker 20.10+ or Docker Desktop
  • Docker Compose 2.0+ (optional, for compose setup)
  • 1GB free disk space
  • Ports 3000 and 8317 available

Quick Start (Docker Run)

1

Build the Image

Clone the CCS repository and build the Docker image:
Build time: ~5-10 minutes (one-time operation).
2

Run the Container

Start the CCS Dashboard container:
Note: --restart unless-stopped ensures the container restarts on system reboot.
3

Access the Dashboard

Open your browser and navigate to:
The CLIProxy API is available at http://localhost:8317 (used by OAuth providers and Dashboard features).

Docker Compose Setup

For production deployments, use Docker Compose for easier management.
1

Create .env File (Optional)

Create a .env file in the docker/ directory to customize ports and configuration:
2

Start with Compose

From the repository root:
View logs:
3

Stop the Service

To remove volumes (delete all config):

CLIProxy API Key Rotation

New integrated Docker deployments generate per-install CLIProxy API and management secrets when custom values are missing. Upgrades from older deployments that used the historical ccs-internal-managed API key keep that legacy key valid beside the new key for 14 days by default. The ccs docker up banner shows only a masked key; use show-key --full when you need to copy the complete value into downstream clients.
Set CCS_DOCKER_LEGACY_KEY_GRACE_DAYS=0 to disable the grace window, or use a larger value when clients need more time to update. If a previous upgrade already replaced the old key before the grace window was available, run once with CCS_DOCKER_RESTORE_LEGACY_API_KEY=1 to explicitly restore temporary compatibility. CCS will not infer this from random-looking custom keys.

Environment Variables

Common CCS environment variables supported in Docker: Example with environment variables:

Persistent Storage

The container uses named volumes for persistent data: Note: Only ccs_home is required. Other volumes are optional (used if you run respective CLIs inside the container).

Backup Configuration

Resource Limits

For production deployments, limit container resources to prevent overconsumption.

Docker Run

Docker Compose

Default limits are set in docker-compose.yml:
Adjust based on workload. Monitor usage with:

Healthcheck

The container includes a healthcheck that verifies:
  1. Dashboard HTTP server (port 3000)
  2. CLIProxy API (port 8317)
Check health status:

Graceful Shutdown

CCS handles SIGTERM gracefully. When stopping the container:
The init: true in docker-compose.yml ensures proper signal forwarding to the Node.js process.

Using Pre-installed CLIs

The container includes pre-installed CLI tools for convenience.

Execute Commands Inside Container

Configure Credentials

Each CLI has its own authentication method. Refer to their respective documentation:

Troubleshooting

Permission Errors (EACCES)

If you see permission errors on startup:

Port Already in Use

Container Keeps Restarting

Debug Mode

Enable verbose logging:
Or update docker-compose.yml:

Image Build Fails

Common issues: Network timeout during build:
Out of disk space:
Cache issues:

Security Best Practices

Secrets Management

For sensitive values like CCS_PROXY_AUTH_TOKEN: Option 1: .env file (not committed to git)
Option 2: Docker secrets (Swarm mode)

Network Security

  • Bind to localhost only - For development:
  • Use reverse proxy - For production (nginx, traefik):

Updates

Regularly rebuild the image to get security patches:

Production Deployment

For production deployments, consider:
  1. Use Docker Compose - Easier management and configuration
  2. Set resource limits - Prevent resource exhaustion
  3. Enable healthcheck - Auto-restart on failures
  4. Use .env file - Separate config from code
  5. Backup volumes - Regular backups of ccs_home
  6. Monitor logs - Centralized logging (ELK, Loki)
  7. Reverse proxy - nginx/traefik with TLS
  8. Secret management - Docker secrets or vault

Next Steps

Remote Proxy Deployment

Deploy CLIProxyAPI on a remote server for centralized access

Multi-Account Setup

Manage multiple OAuth accounts in Docker