Using acme.sh:
wget -O - https://get.acme.sh | sh
source ~/.bashrc
#then get new certificate and setup automatical update
export servername="example.com"
acme.sh --issue -d $servername -w /var/www/$servername/public_html/
acme.sh --install-cert -d $servername --cert-file /etc/letsencrypt/acme/$servername/cert.pem --key-file /etc/letsencrypt/acme/$servername/key.pem --fullchain-file /etc/letsencrypt/acme/$servername/fullchain.pem --reloadcmd "service apache2 force-reload"