Certificate Let's Encrypt on Ubuntu server 22.04 Secure Apache ...

Ubuntu server 16.04

Add the repository, install and create a certificate ...

sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache
sudo certbot --apache -d youdomain.com -d www.youdomain.com -d mail.youdomain.com

Verifying Certbot Auto-Renewal

sudo certbot renew --dry-run

 Ubuntu server 20.04 or 22.04

sudo apt update
sudo apt install certbot

Or

sudo apt install certbot python3-certbot-apache

The command to create a certificate

sudo certbot --apache -d youdomain.com -d www.youdomain.com -d mail.youdomain.com

Verifying Certbot Auto-Renewal

sudo certbot renew --dry-run

Manual renewed run:

sudo certbot renew

...