This is the post for those who have already installed SSL certificate from the Let’s Encrypt.
There may be the case you might have multiple website running on to the server. Then in that case you have to identify the website for which you have to install the certificate.
For this kind of situation there is utility called Certbot come into the picture.
To get the expiry date of the SSL use the following command on server.
sudo certbot certificates
The above command will list down all the certificates with there expiry date
Found the following certs: Certificate Name: binaykumar.com Domains: binaykumar.com www.binaykumar.com Expiry Date: 2022-07-22 01:30:26+00:00 (INVALID: EXPIRED) Certificate Path: /etc/letsencrypt/live/abcdef.com/fullchain.pem Private Key Path: /etc/letsencrypt/live/abcdef.com/privkey.pem Certificate Name: example.com Domains: example.com www.example.com Expiry Date: 2022-07-29 06:02:02+00:00 (VALID: 89 days) Certificate Path: /etc/letsencrypt/live/example.com/fullchain.pem Private Key Path: /etc/letsencrypt/live/example.com/privkey.pem Certificate Name: example1.com Domains: example1.com www.example1.com Expiry Date: 2022-07-29 05:01:11+00:00 (VALID: 89 days) Certificate Path: /etc/letsencrypt/live/example1.com/fullchain.pem Private Key Path: /etc/letsencrypt/live/example1.com/privkey.pem
To Renew a Certificate use Following Command
sudo certbot certonly -d <your-website>.com -d www.<your-website>.com
Note: We are asking for both www and non-www version of certificate
As soon as you will run the above command then it will ask you to authenticate the Acme challenge.
How would you like to authenticate with the ACME CA? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: Spin up a temporary webserver (standalone) 2: Place files in webroot directory (webroot)
Now Enter 2 and simply press enter.Then it will as you for the webroot path where your index.html resides.After entering the valid webroot path it will confirm and start the processing the request made.
the following output you will see if it is successfully processes the request.
Waiting for verification... Cleaning up challenges IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/example123.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/example123.com/privkey.pem Your cert will expire on 2022-07-29. 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 "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
Now Again run the following command you will the updated expiry date.
sudo certbot certificates
Hope you find this post useful.