With Ubuntu 20 released and available, many would be going to host the websites on it. How do you secure Apache with a free SSL ? Lets take a look.

First make sure your domain has its A recorded pointed to the Ubuntu 20 server. Once that is made sure, lets install the certbot.

# apt install certbot python3-certbot-apache

If you have ufw firewall enabled in Ubuntu, make sure to open it for Apache on 80 as well as on port 443.

# ufw allow 'Apache Full'

Now obtain the certificate :

# certbot --apache

Now answer the questions which prompts and that is done.

In case, you find some errors like this - To fix these errors, please make sure that your domain name was entered correctly and the DNS A/AAAA record(s) for that domain contain(s) the right IP address.

Make sure to remove any arbitrary IPv6 records you have in your DNS records and re-run.