Claude Code cannot authenticate from Contabo VPS - Cloudflare blocking claude.ai

Resolved 💬 2 comments Opened Mar 19, 2026 by Vermond21 Closed Apr 17, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code cannot authenticate from a Contabo VPS server. Every request to claude.ai returns a Cloudflare bot challenge, so the CLI cannot authenticate or make any API calls. The error shown is "Unable to connect to API (ECONNREFUSED)".

Direct curl test confirms Cloudflare is blocking the server IP:
curl -I https://claude.ai/api/auth/session
Returns: "Just a moment... Enable JavaScript and cookies to continue"

However, api.anthropic.com is reachable (returns HTTP 405), so the issue is specifically with claude.ai OAuth endpoints being blocked by Cloudflare for this datacenter IP.

What Should Happen?

Claude Code should authenticate and respond normally using a Claude.ai Pro subscription, regardless of whether it's running on a VPS or local machine.

Error Messages/Logs

Unable to connect to API (ECONNREFUSED)
Retrying in X seconds... (attempt X/10)

curl -I https://claude.ai/api/auth/session
Returns Cloudflare challenge: "Just a moment... Enable JavaScript and cookies to continue"

Steps to Reproduce

  1. Get a Contabo VPS server (Frankfurt datacenter, IP: 144.91.78.125)
  2. Install Claude Code: npm install -g @anthropic-ai/claude-code
  3. Copy valid credentials with subscriptionType:"pro" to ~/.claude/.credentials.json
  4. Run: claude
  5. Send any message
  6. Observe: "Unable to connect to API (ECONNREFUSED)"

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Claude Code Version: 2.1.79

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗