certbot docker

Nikola Mandic
1 min readJan 1, 2020

I can’t remember how many times I searched for how to get certbot get certificate with docker and its always somewhere hard to find :-D

Here it is in more convenient place stashed so one can copy paste

docker run -it — rm — name certbot -v “/etc/letsencrypt:/etc/letsencrypt” -v “/var/lib/letsencrypt:/var/lib/letsencrypt” -p 443:443 -p 80:80 certbot/certbot certonly — standalone — preferred-challenges http -d mysite.com

This will put certificates in local drive and wont require intervention from command line.