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.

2 comments so far

Add Your Comment
  1. Bart Dorlandt

    Didn’t you had to expose any ports during this proces, or was this server on NAT and didn’t you have to worry about ports that way?

  2. Mischa ter Smitten

    No, I run the docker container locally and create the needed files (e.g. .well-known/acme-challenge/XXXX) by hand on the remote server.