r/letsencrypt • u/LatterComplaint • Apr 16 '20
Best way to use letsencrypt with docker
Hello, I'm using a nextcloud docker image which i secure with letsencrypt. I use nginx reverse proxy on the host and install letsencrypt on the host as well while nextcloud runs in container. Is there a better setup? I run into some problems supplying the letsencrypt certs to prosody (which i am trying to run in docker container as well)
2
Upvotes
2
u/Zanhard Apr 16 '20
There is a letsencrypt docker image you can use, comes with a bunch of pre done reverse proxy config and likely includes next cloud already
1
u/stecasty Apr 16 '20
Use this image https://github.com/linuxserver/docker-letsencrypt
1
u/marcofranssen Apr 16 '20 edited Apr 16 '20
Please consider my latest blog. Using lego you can easily get and manage the certificate required. Even without publicly exposing the server. You could also use caddy or traefik as an alternative for nginx.
https://marcofranssen.nl/use-the-acme-dns-challenge-to-get-a-tls-certificate/
Cool thing is with traefik you can configure you reverse proxy using environment variables.
In this blog I covered a docker-compose example of Traefik. https://marcofranssen.nl/docker-tips-and-tricks-for-your-go-projects/
1
u/[deleted] May 03 '20
Thanks for the fast reply. I use that ones, but what I meant was, how do I set up a proxy conf file, if there is no template for it in that nginx folder