SSL certification is very important for the security of a website. It has become the de facto standard on the web. Therefore it is crucial that you get an SSL certificate and have your website communicate over HTTPS. For that we will use SSL certification provided by Let’s Encrypt.
Let’s Encrypt is a none profit organization that provides TLS certification for free, in an effort to make the internet safe and secure for all. We will make use of a tool called Certbot to automatically install and manage the certificate.
What is Certbot?
Certbot is an open-source software tool that allows automatic installation of Let’s Encrypt SSL certificate on a web server.
How to install Certbot and SSL with apache?
sudo snap install core; sudo snap refresh core
Then Install certbot
sudo snap install --classic certbot
Prepare the certbot command
sudo ln -s /snap/bin/certbot /usr/bin/certbot
Install the certificate
sudo certbot --apache
If this fails due to “403 forbidden” it could be because the folder /var/lib/letsencrypt has the wrong permissions
This will change the permissions of the directory and will allow apache to do the challenge required to get the certificate
sudo chmod o+rx /var/lib/letsencrypt
Test if the auto renewal is working
sudo certbot renew --dry-run
If you find any mistakes or if this content gets outdated please leave a comment.