Problem: certbot always grabs a new certificate instead of keeping one that is not yet up for renewal (–keep is used). It saves the output to /etc/letsencrypt/live/$domain-0001/ instead of just …/live/$domain/. The next run, it’ll be -0002, etc.
My domain is: lucgommans.nl
I ran this command: certbot certonly --agree-tos -n --webroot -w /var/www/html/ --keep --cert-name lgms --email firstname.lastname@example.org -d lgms.nl,lucgommans.nl,www.lgms.nl,www.lucgommans.nl
It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for lgms.nl
http-01 challenge for lucgommans.nl
http-01 challenge for www.lgms.nl
http-01 challenge for www.lucgommans.nl
Using the webroot path /var/www/html for all unmatched domains.
Waiting for verification…
Cleaning up challenges
live directory exists for lgms
On the second run, the last line of output is omitted; instead, it reports:
- Congratulations! Your certificate and chain have been saved at:
Your key file has been saved at:
Your cert will expire on 2019-06-30. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew all of your certificates, run
My web server is (include version): nginx
The operating system my web server runs on is (include version): Debian stretch
My hosting provider, if applicable, is: myself
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 0.28.0
I used a very similar command on my previous server (it used ‘letsencrypt’ instead of ‘certbot’, and the --agree-tos, -n, and --cert-name flags are new, the rest is the same) and it did not have this issue. Running
letsencrypt --version gives certbot 0.31.0. It has had this behaviour for years, though, so it’s not as if it could have been broken in 0.28. And it’s a different host so it’s not a downgrade that might mess up data files.
I found a handful of other pages about this, among which this other forum thread, but they seem to be about different things (in the case of the forum thread, I am not requesting partially overlapping names but 100% identical names).
PS. I could not really tell from the forum descriptions whether to post in Server or in Help: the former mentions certbot, but the latter also totally applies, so I chose server as the one with a more specific name.