Setup Apache vhost with LetsEncrypt certificate on Debian

Setup virtualhost on /etc/apache2/sites-available/domain.tld.conf:

<VirtualHost *:80>
    ServerName domain.tld
    ServerAdmin webmaster@domain.tld
    DocumentRoot /var/www/html
    <Directory /var/www/html>
        Options -Indexes +FollowSymLinks
        AllowOverride All
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/domain.tld-error.log
    CustomLog ${APACHE_LOG_DIR}/domain.tld-access.log combined
</VirtualHost>


Enable website:
sudo a2ensite domain.tld
systemctl reload apache2


Install LetsEncrypt:
apt update
apt install snapd
snap install core
snap refresh core
snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot


Install certificate for domain.tld:
certbot --apache -d domain.tld
systemctl restart apache2