sudo apt update
sudo apt install certbot python3-certbot-apache
sudo certbot --apache
Certbot automatically sets up a cron job to renew your certificates before they expire. You can verify the renewal configuration by running:
sudo certbot renew --dry-run