BK cloud / systems Notes
EN
English ENDeutsch DEEspañol ES中文 ZHFrançais FRPortuguês (Brasil) PT-BR日本語 JAहिन्दी HINederlands NL
Let’s connect ↗
← Back to field notes

wordpress and let’s encrypt

Archive note: This article documents the Ubuntu and Certbot tooling available in 2019.

Here is how to configure a Let’s Encrypt TLS certificate on Ubuntu 18.04, assuming that Apache, a LAMP stack, and WordPress are already running and that you control the domain.

add-apt-repository ppa:certbot/certbot
apt install python-certbot-apache
certbot –apache -d berndkuhlen.de -d www.berndkuhlen.de
certbot renew –dry-run

Make sure you have a Certbot cron job to keep the certificate current.

Here is what mine looks like:

0 0 * * * /usr/bin/certbot renew >/home/ubuntu/certbot.txt 
2>/home/ubuntu/certbot.err

Here is my configuration, which was generated automatically:

renew_before_expiry = 30 days
version = 0.31.0
archive_dir = /etc/letsencrypt/archive/berndkuhlen.de
cert = /etc/letsencrypt/live/berndkuhlen.de/cert.pem
privkey = /etc/letsencrypt/live/berndkuhlen.de/privkey.pem
chain = /etc/letsencrypt/live/berndkuhlen.de/chain.pem
fullchain = /etc/letsencrypt/live/berndkuhlen.de/fullchain.pem
Options used in the renewal process
[renewalparams]
account = SOMEACCOUNTID
authenticator = apache
installer = apache
server = https://acme-v02.api.letsencrypt.org/directory

I was surprised to see that Certbot automatically updated my Apache configuration to include the new certificate and listen on port 443.