How to automatically renew Let's Encrypt SSL certificates?

David Beroff

Well-known member
Registered
Joined
Jun 14, 2016
Messages
1,477
Points
63
Is anyone here using SSL certificates from Let's Encrypt? I don't check my email regularly, I guess if they notice when my SSL is expire someday it will give issues to my sites. Is there to create a cron job or automatically renew Let's Encrypt SSL certificates from SSH? can it work for all type of hosting panels as cpanel, plesk or others?
 

rankmyhub

Well-known member
Registered
Joined
Feb 14, 2017
Messages
193
Points
18

David Beroff

Well-known member
Registered
Joined
Jun 14, 2016
Messages
1,477
Points
63
@rankmyhub

There are so many commands there, I don't know which command i should follow

This

Code:
/opt/letsencrypt/letsencrypt-auto renew
or this

Code:
01 23 * * * root /root/scripts/getssl/getssl -u -a -q >>/var/log/getssl.log 2>&1 ; /usr/sbin/apache2ctl graceful
Can i create a cron with UI on my hosting panel? It will be easier.

Another question is, i can run the command before my SSL is expired? or before they notice me via email?
 

rankmyhub

Well-known member
Registered
Joined
Feb 14, 2017
Messages
193
Points
18
Set up a CRON Job within cPanel as follows, which runs every 2 months;

HTML:
0 0 */60 * * /root/.local/share/letsencrypt/bin/letsencrypt –text certonly –renew-by-default –webroot –webroot-path /home/{YOUR ACCOUNT HERE}/public_html/ -d example.com -d www.example.com; /root/installssl.pl example.com
For reference, The SSL certificate is placed in /etc/letsencrypt/live/bundle.txt when installing Let's Encrypt.

Note on adding CRON job to cPanel, this is within cPanel WHM, not a cPanel user account. cPanel user accounts don't have root privileges so a CRON job from within here won't work. To edit the CRON job at the root level, first SSH into your server, then run the following command to edit the main CRON job file;

HTML:
crontab -e
Add the CRON job details to this file at the bottom. Save the file. Then restart the CRON deamon with the following command;

HTML:
service crond restart
It is recommended to have a 2 month renewal time at first as this gives you 4 weeks to sort this out before your certificate expires. Thankfully you should receive an email from your CRON service if this happens and you will also receive an email from Let's Encrypt when the certificate is about to expire so there are double safe guards in place to do this.

If you have whm acccess,, actually cpanel have auto ssl option which takes care everything including letsencrypt ssl installation and auto renewal.

https://documentation.cpanel.net/display/ALD/Manage+AutoSSL

But you need to verify which version of WHM you are using. They introduced the script that loads this plugin in cPanel & WHM version 58.0.17. So if your CPanel is latest version, you already have LetEncrypt SSL option enabled. Installation is just one click.

https://www.youtube.com/watch?v=dicothpT6Os

Also, you can watch our youtube channel where we have a tutorial demonstarting how to install letsencrypt ssl using cpanel plugin.

There is no single corn job or single command for installation or renewal of letsencrypt as it is dependent on underlying OS and web server, thats why they have provided complete command list suitable for each case, I pasted link in earlier post. Hope this helps you.

Your best option, is to upgrade your WHM to latest version, so that you can use all GUI way, without dealing with cornjobs and commands.
 
Older Threads
Replies
8
Views
5,818
Replies
9
Views
6,337
Replies
4
Views
2,414
Replies
29
Views
16,880
Recommended Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top