Simple Way to add Let's encrypt SSL on Ubunntu

 We are Instaiing SSL on  this configuration :

6.2.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Oct  5 22:43:45 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux


To add Let's Encrypt SSL and automate the renewal process on your Ubuntu 22.04 server running Apache, you can use Certbot, a widely used tool for managing SSL certificates. Here are the steps to install Let's Encrypt and set up automatic renewal:


Step 1: Install Certbot

Run the following commands to install Certbot:


sudo apt update

sudo apt install certbot python3-certbot-apache



Step 2: Obtain a Let's Encrypt SSL Certificate

Run the Certbot command and follow the interactive prompt to obtain an SSL certificate for your domain. Replace your_domain with your actual domain name:


sudo certbot --apache -d your_domain


Step 3: Automate the Renewal Process

Certbot automatically configures a scheduled task to renew your SSL certificates. However, you can verify it by running:

sudo certbot renew --dry-run


Step 4: Configure Automatic Renewal

You can set up a cron job to automatically renew the certificates:

sudo crontab -e


Add the following line to the crontab file to run the renewal check every day at a random time:

0 0 * * * certbot renew


Save and exit the crontab file.


Step 5: Verifying the Renewal

You can check the renewal process using the following command:

sudo systemctl status certbot.timer


This command will display the status of the Certbot timer and whether the renewal is being attempted as scheduled.


With these steps, you should have successfully added Let's Encrypt SSL to your Apache server and set up the automated renewal process to ensure that your SSL certificates remain valid.

No comments:

Post a Comment

Pages