Cannot generate ssl certificate even though ufw enables 80 and 443

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: demmybrands.com

I ran this command: sudo certbot --nginx -d demmybrands.com -d www.demmybrands.com

It produced this output: ubuntu-1055759@1055759-ubuntu-2025-feb:~$ sudo certbot --nginx -d demmybrands.com -d www.demmybrands.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for demmybrands.com and www.demmybrands.com

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: demmybrands.com
Type: connection
Detail: 145.24.222.214: Fetching http://demmybrands.com/.well-known/acme-challenge/cDqziygNCLiNVV52WEYvrmdS5ZFvY8hJJ-Hf-aGD8Gs: Timeout during connect (likely firewall problem)

Domain: www.demmybrands.com
Type: connection
Detail: 145.24.222.214: Fetching http://www.demmybrands.com/.well-known/acme-challenge/2L5yGTAS37uJ8bLcNTi3Ccnf5XvDap0IB_MxbTxLAZo: Timeout during connect (likely firewall problem)

Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.

Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
ubuntu-1055759@1055759-ubuntu-2025-feb:~$

My web server is (include version): nginx version: nginx/1.24.0 (Ubuntu)

The operating system my web server runs on is (include version):
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble
My hosting provider, if applicable, is:
"ip": "145.24.222.214",
"hostname": "cle.cmgt.hr.nl",
"city": "Rotterdam",
"region": "South Holland",
"country": "NL",
I can login to a root shell on my machine (yes or no, or I don't know):
yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
no
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):certbot 2.9.0

Welcome @demmy

Your website cannot be reached (times out) from everywhere except the Netherlands.

To use an HTTP Challenge (which the --nginx option uses) your site must be available world-wide. Let's Encrypt will check from various points around the globe.

An excellent wiki about this is here: Multi-Perspective Validation & Geoblocking FAQ

Here is results from a global testing site: Check website performance and response : Check host - online website monitoring

4 Likes