sudo add-apt-repository ppa:certbot/certbot
sudo add-apt-repository universe
sudo apt update
sudo apt install certbot python3-certbot-apache
sudo nano /etc/apache2/sites-available/your_domain.conf
File: /etc/apache2/sites-available/your_domain.conf
...
ServerName your_domain;
...
sudo ufw allow 'Apache Full'
sudo ufw delete allow 'Apache'
sudo certbot --apache -d your_domain -d www.your_domain
To check the status of this service and make sure it’s active and running, you can use:
sudo systemctl status certbot.timer
To test the renewal process, you can do a dry run with certbot:
sudo certbot renew --dry-run