From 203e6065d1aa2e8f9b4a2417bdd275be9571c7f6 Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 31 Jan 2017 00:13:26 +0100 Subject: [PATCH] Add docker letsencrypt example --- Configure-SSL.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Configure-SSL.md b/Configure-SSL.md index da03e1b..c100732 100644 --- a/Configure-SSL.md +++ b/Configure-SSL.md @@ -17,6 +17,28 @@ To enable Let's Encrypt on your mail server, you have to: You don't have anything else to do. Enjoy. +#### Example using docker for letsencrypt +Make a directory to store your letsencrypt logs and configs. + +In my case +``` +mkdir -p /home/ubuntu/docker/letsencrypt/log +mkdir -p /home/ubuntu/docker/letsencrypt/etc/letsencrypt +``` + +Now get the certificate (modify ```mail.myserver.tld```) and following the certbot instructions. +This will need access to port 443 from the internet, adjust your firewall if needed +``` +docker run --rm -ti -v $PWD/log/:/var/log/letsencrypt/ -v $PWD/etc/:/etc/letsencrypt/ -p 443:443 deliverous/certbot certonly --standalone -d mail.myserver.tld +``` +You can now mount /home/ubuntu/docker/letsencrypt/etc/letsencrypt in /etc/letsencrypt of ```docker-mailserver``` + +To renew your certificate just run (this will need access to port 443 from the internet, adjust your firewall if needed) +``` +docker run --rm -ti -v $PWD/log/:/var/log/letsencrypt/ -v $PWD/etc/:/etc/letsencrypt/ -p 443:443 deliverous/certbot renew +``` + + ### Self-signed certificates (testing only) You can easily generate a self-signed SSL certificate by using the following command: