diff --git a/docs/content/config/security/ssl.md b/docs/content/config/security/ssl.md index da03e1b9..c100732a 100644 --- a/docs/content/config/security/ssl.md +++ b/docs/content/config/security/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: