Your issue stems from Certbot attempting to renew all certificates in your configuration, but failing for domains where DNS challenges (or other challenges) are not passing. You want to renew only those certificates that pass the verification challenge—i.e., only the ones that Certbot can successfully verify.
Certbot does not have a built-in flag to "only renew if the challenge passes," but you can:
Run a dry-run to see which certificates would pass:
bashcertbot renew --dry-run --nginx-ctl /usr/sbin/nginx
This will simulate the renewal process and show you which domains would succeed.
From your last successful renewal, you see:
gitea.lemnoslife.com-0001overleaf.lemnoslife.compim.etesync.lemnoslife.comserver0.lemnoslife.comv.lemnoslife.comvideos.lemnoslife.comThese are the domains that did pass the challenge.
You can use the --cert-name or --domains flag to target only the certificates you want to renew.
--cert-namebashcertbot renew --cert-name gitea.lemnoslife.com-0001 --nginx-ctl /usr/sbin/nginx certbot renew --cert-name overleaf.lemnoslife.com --nginx-ctl /usr/sbin/nginx certbot renew --cert-name pim.etesync.lemnoslife.com --nginx-ctl /usr/sbin/nginx certbot renew --cert-name server0.lemnoslife.com --nginx-ctl /usr/sbin/nginx certbot renew --cert-name v.lemnoslife.com --nginx-ctl /usr/sbin/nginx certbot renew --cert-name videos.lemnoslife.com --nginx-ctl /usr/sbin/nginx
--domainsIf you want to renew all domains in a certificate config file:
bashcertbot renew --domains gitea.lemnoslife.com,v.lemnoslife.com --nginx-ctl /usr/sbin/nginx
(Replace the domains with the ones you want to renew.)
If you want to automate this, you can write a script that:
certbot renew --dry-run to identify which certificates would succeed.bash#!/bin/bash # Dry-run to get successful domains successful_domains=( "gitea.lemnoslife.com-0001" "overleaf.lemnoslife.com" "pim.etesync.lemnoslife.com" "server0.lemnoslife.com" "v.lemnoslife.com" "videos.lemnoslife.com" ) # Renew only the successful domains for domain in "${successful_domains[@]}"; do certbot renew --cert-name "$domain" --nginx-ctl /usr/sbin/nginx done
Save this as renew_certs.sh, make it executable (chmod +x renew_certs.sh), and run it.
For the domains that failed (gitea.lemnoslife.com, gitlab.lemnoslife.com, private.yt.lemnoslife.com), check:
A and AAAA records exist for all domains.private.yt.lemnoslife.com. Wait before retrying.You can use Certbot's --pre-hook and --post-hook to run checks before/after renewal, but this is more complex.
certbot renew --dry-run --nginx-ctl /usr/sbin/nginxcertbot renew --cert-name DOMAIN --nginx-ctl /usr/sbin/nginxLet me know if you want help writing a more sophisticated script or debugging a specific domain!