Letsencrypt renewal fails and broken > Solution

Seems that since/from December 2018 the auto renewal fails and my letsencrypt certificate run out of valid.
I have checked the /etc/letsencrypt configuration and it seems that this was broken all relevant directories had an -0001 duplicated and “/renewal/YOURDOMAIN.conf” was an empty file.

!!! FIRST backup the entire folder /etc/letsencrypt

I remove all old folders and files with the YOURDOMAIN in folders archive, live, renewal > and set the YOURDOMAI-0001 as productive. Because these were the newer files.

In “live/YOURDOMAIN/” I changed the links to the right destination:
lrwxrwxrwx 1 root root 46 Mar 3 17:56 cert.pem -> …/…/archive/YOUDOMAIN/cert1.pem

sudo vi /etc/letsencrypt/renewal/YOURDOMAIN.conf

Run first
sudo ./letsencrypt-auto renew --dry-run
(At this point I received the information to modify “/etc/letsencrypt/renewal/YOURDOMAIN.conf”, step before)

sudo ./letsencrypt-auto
Only install the certificate and no other step like redirect.

With any other task the certificate has been accepted.

Hope the manuel could help someone else how has the same issue ad don’t hesitate to ask if you have questions.
May there is an smarter way but this has worked for me :slight_smile:

best regards

Just to add: if you run the Nextcloud VM you simply just need to run the activate-ssl.sh script again.

The steps would be:

  1. wget https://raw.githubusercontent.com/nextcloud/vm/master/lets-encrypt/activate-ssl.sh
  2. sudo bash activtae-ssl.sh
  3. Follow the instructions and your’re done.

You can find the Nextcloud VM here: https://www.hanssonit.se/nextcloud-vm/

1 Like