Certbot SSL on Debian Linux (Ubuntu)

To install Certbot on Ubuntu and configure SSL, you can use the following steps:

To install Certbot on Ubuntu and configure SSL, you can use the following steps:


1. Update the package manager:

   sudo apt-get update

2. Install Certbot:

   sudo apt-get install certbot

3. Install the Certbot plugin for Apache:

   sudo apt-get install python3-certbot-apache

4. Allow HTTPS traffic through the firewall:

   sudo ufw allow 'Apache Full'

   This will allow HTTPS traffic and open ports 80 and 443 in the firewall.

5. Test the Apache configuration to make sure it's valid:

   sudo apachectl configtest

6. If the Apache configuration is valid, reload Apache to apply the changes:

   sudo systemctl reload apache2

7. Use Certbot to obtain a SSL certificate:

sudo certbot --apache -d yourdomain.com

sudo certbot --apache -d yourdomain.com -d www.yourdomain.com

   Replace `yourdomain.com` and `www.yourdomain.com` with your actual domain names.

   Certbot will guide you through the process of obtaining a SSL certificate and configuring Apache to use it.

8. Test the SSL certificate by visiting your website using HTTPS.

   If everything is configured correctly, you should see a green padlock icon in your web browser, indicating that your website is using a valid SSL certificate.

That's it! You've successfully installed Certbot on Ubuntu and configured SSL for your website. Note that you will need to renew the SSL certificate periodically to ensure that it remains valid. Certbot will automatically send you reminders when it's time to renew the certificate.

How to delete and reinstall SSL certificates with certbot on Ubuntu ?

certbot certificates

# find the path to the fullchain certificate you wish to reinstall

certbot revoke --cert-path /etc/letsencrypt/live/www.yourdomain.com/fullchain.pem #path to the cert from above

certbot delete --cert-name yourdomain.com

rm -Rf /etc/apache2/sites-available/000-default-le-ssl.conf #or whatever the name of the apache conf you had it configured on 

rm -Rf 000-default-le-ssl.conf #or whatever the name of the apache conf you had it configured on

sudo apache2ctl restart

certbot #follow the guide to setup the new certificate

More : How To Install SSL On RHEL (Fedora)