How to renew Let's Encrypt certificate automatically?

Hello,
I found a post about this title in https://community.letsencrypt.org/t/how-to-automatically-renew-certificates/4393, but it is old and I want to know how can I renew Let's Encrypt certificate automatically?
How can I check when my certificate expires?

Thank you.

1 Like

Hi,

There's some information needed in order to answer your questions.

What's your website (domain)?
Where do you host it?
How did you set up the first certificate?
What client did you use to obtain the first certificate?

Without these information it's hard for us to know anything out of you or answer your questions.

Thank you

1 Like

This greatly depends upon which ACME client (e.g. certbot) you are using.

Have you received any expiration emails?

You can find all of the information about your issued certificates here:

2 Likes

The result is:

$ sudo certbot renew --dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/MyDomain.net.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for MyDomain.net
http-01 challenge for www.MyDomain.net
Waiting for verification...
Cleaning up challenges

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new certificate deployed with reload of apache server; fullchain is
/etc/letsencrypt/live/MyDomain.net/fullchain.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates below have not been saved.)

Congratulations, all renewals succeeded. The following certs have been renewed:
  /etc/letsencrypt/live/MyDomain.net/fullchain.pem (success)
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.

You just need a scheduled mechanism (e.g. crontab) to run the following every day (or week):
sudo certbot renew

Thank you, but no automatically solution?

@griffin literally gave you the automatic solution--set up a crontab (or other scheduled mechanism--i.e., a method to automate) to run certbot renew daily.

1 Like