A few weeks ago I was upgrading / migrating / reinstalling my old server. This was a nice opportunity to finally play around with Let’s Encrypt, so I could setup https for all my sites. After reading the documentation it looked like I needed to install all sorts of dependencies on my machine. That was something a wasn’t to happy about. Digging some further revealed that it was also possible to use Docker to run all the commands, so I decided to do that:

sudo docker run -it --rm --name letsencrypt \
  -v $PWD/files/letsencrypt/etc/letsencrypt:/etc/letsencrypt \
  -v $PWD/files/letsencrypt/var/lib/letsencrypt:/var/lib/letsencrypt \
  quay.io/letsencrypt/letsencrypt:latest \
  certonly \
  --manual \
  --email mischa@tersmitten.nl \
  --agree-tos \
  -d blog.tersmitten.nl \

This way I could run all the commands, without installing the dependencies (on any machine). Also I was able to pick any location to store the letsencrypt files.