# How to Fix Caddy ACME HTTP-01 TLS Certificate Failure (2026 Verified Ubuntu/Docker Fix)

- URL: https://nodebudget.dev/errors/caddy-acme-http01-tls-failed/
- Category: HTTPS & Caddy · Severity: Medium
- Author: Yuanqiang Leng (https://github.com/a895047059)
- Updated: 2026-11-26

## Exact Log Signature
`obtaining certificate: HTTP 400 urn:ietf:params:acme:error:unauthorized`

## Root Cause
Port 80 is blocked by UFW/firewall, occupied by Apache/Nginx, or Cloudflare orange-cloud proxy conflicts with HTTP-01 challenge.

## Verified Fix Commands
```bash
sudo ss -tulpn | grep -E ':80|:443'
sudo ufw allow 80/tcp && sudo ufw allow 443/tcp
# If behind Cloudflare, set SSL/TLS mode to Full (Strict) or use DNS-01 / cloudflared.
```

## Permanent Production Prevention
Check port 80 listeners before launching Caddy on a fresh VPS.

---
Source: NodeBudget (https://nodebudget.dev/tools/error-decoder/)
