certbot "Timeout during connect" — Check Port 80
When certbot fails with "Timeout during connect (likely firewall problem)", find where port 80 is blocked by testing from inside the server, then from outside.
Type: connectionDetail: 203.0.113.10: Fetching http://example.com/.well-known/acme-challenge/…: Timeout during connect (likely firewall problem)This means the Let's Encrypt validation server could not open a connection to port 80 of your domain at all. It is not a certificate or config-file problem, so first find where the connection dies.
[1] Do not retry real issuance. Test with --dry-run, which uses the staging server and does not count against rate limits. Re-run it after each fix below.
# certbot certonly --nginx --dry-run -d example.com[2] Check that the domain points at the right server. HTTP-01 validation happens on port 80 only; you cannot choose another port. If the A record differs from the server's public address, the request goes elsewhere.
$ dig +short A example.com$ dig +short AAAA example.com[3] Check that a process listens on port 80. 127.0.0.1 in the Local Address column is unreachable from outside; you need 0.0.0.0:80 or [::]:80.
# ss -tlnp 'sport = :80'Below is the same check with Nginx bound to 127.0.0.1 only (listen 127.0.0.1:…). The test used port 18831 instead of 80.
# ss -tlnp 'sport = :18831'State Recv-Q Send-Q Local Address:Port Peer Address:PortProcessLISTEN 0 511 127.0.0.1:18831 0.0.0.0:* users:(("nginx",pid=…,fd=5),("nginx",pid=…,fd=5))[4] From the server itself, request the challenge path through its non-loopback address. With the bind from step 3, loopback returns 200 but the other address is refused.
$ curl -s -i http://127.0.0.1:18831/.well-known/acme-challenge/probe | head -n 1HTTP/1.1 200 OK$ curl -sS -m 5 http://203.0.113.10:18831/.well-known/acme-challenge/probecurl: (7) Failed to connect to 203.0.113.10 port 18831 after 0 ms: Couldn't connect to server[5] From a computer outside (another VPS, phone data), send the same request. The validation server also comes from outside, so test from the same position.
$ curl -sS -m 10 --connect-timeout 5 http://example.com/.well-known/acme-challenge/probeWhen the connect phase gets no answer, it ends like this after --connect-timeout. The test used the documentation address 192.0.2.10, which does not answer.
$ curl -sS -v --connect-timeout 5 http://192.0.2.10:18831/.well-known/acme-challenge/probe* Trying 192.0.2.10:18831...curl: (28) Failed to connect to 192.0.2.10 port 18831 after 5002 ms: Timeout was reached[6] If it times out from outside too, look for the layer that drops port 80, top down. Read the server's own firewall with read-only commands.
| Where | Check |
|---|---|
| Server firewall | sudo ufw status verbose · sudo nft list ruleset |
| Cloud security group / firewall | inbound 80/tcp allowed (in the console) |
| Router / port forwarding | external 80 → server 80 |
| ISP | some residential lines block port 80 |
[7] If a fix changed nothing, check that the firewall rule was actually saved. In a community thread the added rules had never been saved; after saving them, renewal worked. Run the --dry-run from step 1 again.
# certbot certonly --nginx --dry-run -d example.comAnalyze your Nginx log in the browser ↗ — nothing is uploaded.
Check it with the Certificate (PEM · X.509) decoder tool ↗ — calculated in your browser.