Before fixing anything, identify exactly what's failing. Check service status, logs, and current configuration.
# Check tunnel service status
sudo systemctl status cloudflared
# View recent error logs
sudo journalctl -u cloudflared -n 50
# Check if DNS record exists
nslookup your-domain.com
dig your-domain.com
# Test local service
curl -I http://localhost:80
โ ๏ธ
Common Error Messages
Look for: "Tunnel credentials file doesn't exist", "Cannot determine default origin certificate", "Failed to start", or "Access through untrusted domain"
Re-authenticate with Cloudflare and create a new tunnel with proper credentials handling.
# Re-authenticate with Cloudflare
cloudflared tunnel login
# Create new tunnel with descriptive name
cloudflared tunnel create your-project-name
# Note the tunnel ID from output
# Example: Created tunnel your-project-name with id 86e1a942-f0f6-47aa-954d-8011f027dd47
โ
Success Indicators
You should see "Created tunnel [name] with id [uuid]" and credentials file created in ~/.cloudflared/
Always test the tunnel manually before creating the systemd service to catch configuration errors early.
# Test tunnel configuration manually
sudo cloudflared tunnel --config /etc/cloudflared/config.yml run
# You should see:
# - "Starting tunnel tunnelID=YOUR_TUNNEL_ID"
# - "Registered tunnel connection" messages
# - No error messages about missing files
# Press Ctrl+C to stop the manual test
๐ฏ
Success Indicators
Look for "Registered tunnel connection" entries with different connection IDs and IP addresses.
The most critical step - ensure DNS points to your NEW tunnel ID, not an old one.
# In Cloudflare Dashboard:
# 1. Go to DNS โ Records
# 2. Find your domain's CNAME record
# 3. Update the target to: YOUR_TUNNEL_ID.cfargotunnel.com
# 4. Ensure Proxy status is "Proxied" (orange cloud)
# Verify DNS propagation
nslookup your-domain.com
dig your-domain.com CNAME
# Test the connection
curl -I https://your-domain.com
๐
DNS Update Critical
This is the most common failure point. Old DNS records pointing to deleted tunnels cause 404 errors.
Confirm everything is working and set up monitoring to catch future issues.
# Check service status
sudo systemctl status cloudflared
# Monitor live logs
sudo journalctl -u cloudflared -f
# Test complete functionality
curl -I https://your-domain.com
curl -I https://your-domain.com/your-app-path
# List active tunnels
cloudflared tunnel list
# Check tunnel info
cloudflared tunnel info YOUR_TUNNEL_ID
๐
Success Indicators
Service shows "active (running)", no error logs, your domain responds with 200 OK, and your application loads properly.