Skip to main content
The Claude Code Copilot proxy listens on a configurable port for incoming API requests. Understanding port configuration is essential for running multiple instances or resolving conflicts.

Default port

By default, the proxy server runs on port 18080:
node scripts/proxy.mjs
# Server starts on http://localhost:18080
Source: scripts/proxy.mjs:18

Changing the port

Set the COPILOT_PROXY_PORT environment variable to use a different port:
export COPILOT_PROXY_PORT=3000
node scripts/proxy.mjs
When you change the port, update your Claude Code configuration:
# If proxy runs on port 3000
export ANTHROPIC_BASE_URL=http://localhost:3000
export ANTHROPIC_API_KEY=copilot-proxy
claude

Port conflicts

If port 18080 is already in use, you’ll see this error:
βœ— Port 18080 is already in use.
  Kill the existing process:  lsof -ti:18080 | xargs kill -9
  Or use a different port:    COPILOT_PROXY_PORT=18081 node scripts/proxy.mjs
Source: scripts/proxy.mjs:1322-1324

Resolving port conflicts

The simplest solution is to run the proxy on a different port:
COPILOT_PROXY_PORT=18081 node scripts/proxy.mjs
Then update Claude Code to use the new port:
export ANTHROPIC_BASE_URL=http://localhost:18081
export ANTHROPIC_API_KEY=copilot-proxy
claude
Find which process is using port 18080:
# Find the process ID
lsof -ti:18080

# Kill the process
lsof -ti:18080 | xargs kill -9
You may have already started the proxy server. Verify it’s responding:
curl http://localhost:18080/health
Expected response:
{"status":"ok","provider":"github-copilot"}
If you get this response, the proxy is already running and ready to use.Source: scripts/proxy.mjs:876-879

Docker port mapping

When using Docker, the port mapping is defined in docker-compose.yml:
docker-compose.yml
services:
  proxy:
    ports:
      - "18080:18080"  # host:container
    environment:
      - COPILOT_PROXY_PORT=18080
Source: docker-compose.yml:6-11 To use a different port on the host:
docker-compose.yml
services:
  proxy:
    ports:
      - "3000:18080"  # Access proxy at http://localhost:3000
    environment:
      - COPILOT_PROXY_PORT=18080  # Container still uses 18080 internally
Then configure Claude Code:
export ANTHROPIC_BASE_URL=http://localhost:3000
export ANTHROPIC_API_KEY=copilot-proxy
claude

Running multiple instances

You can run multiple proxy instances on different ports:
COPILOT_PROXY_PORT=18080 node scripts/proxy.mjs
Each instance can have different configurations:
Instance with Brave Search
COPILOT_PROXY_PORT=18080 \
BRAVE_API_KEY=your-key \
node scripts/proxy.mjs
Instance without Brave Search
COPILOT_PROXY_PORT=18081 node scripts/proxy.mjs

Health check endpoint

Verify the proxy is running and check which port it’s using:
curl http://localhost:18080/health
Response:
{
  "status": "ok",
  "provider": "github-copilot"
}
This endpoint is useful for:
  • Monitoring server health
  • Verifying the correct port
  • Load balancer health checks
  • Docker container health checks
Source: scripts/proxy.mjs:876-879