Use Let's Encrypt in Apache/Ubuntu

It’s a matter of time until hosting providers offer HTTPS on theirs VPS with Let’s Encrypt certificates with a single click, until then…

Install the Let’s Encrypt client:

$ sudo git clone /opt/letsencrypt

Request the certificate(s). For multiple domains use as many -d domain-name as needed:

$ /opt/letsencrypt/letsencrypt-auto --apache -d -d

Let’s Encrypt certificates are valid for 90 days, and you can automate the renewal process using crontab:

$ sudo crontab -e

As the process won’t do anything until the certificates are due for renewal, let’s schedule it once a week (tuesdays at 1 am):

0 1 * * 2 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/letsencrypt.log