https://www.baeldung.com/linux/letsencrypt-renew-ssl-certificate-automatically
sudo apt-get install software-properties-common
sudo apt-get update
sudo apt-get install certbot
# this did not worksudo apt-get install python-certbot-apache #this did!sudo apt-get install python3-certbot-apache
sudo certbot --apache
To manually renew
sudo certbot renew --apache