Install Certbot: Certbot is a tool that makes it easy to get and manage Let’s Encrypt SSL certificates. To install Certbot, follow the instructions on the official website for your operating system.
Obtain a certificate: To obtain a certificate, run the following command: certbot –nginx. This command will automatically obtain and configure a certificate for your domain.
Verify the certificate: Verify that the certificate has been installed correctly by visiting your website using https.
Configure automatic renewal: Certbot renews certificates automatically by default, but you should verify that the renewals are configured properly. To check the renewal configuration, run the following command: certbot renew –dry-run. If the renewals are properly configured, the output will show that the certificate will be renewed.
Set up a cron job: To make sure that the certificate is automatically renewed, set up a cron job to run the renewal command periodically. The following example sets up a cron job to run the renewal command once per day:
Copy code
0 0 * * * certbot renew
This cron job runs the certbot renew command every day at midnight.
By following these steps, you can configure Let’s Encrypt for automatic certificate renewal and keep your website secure.