The LinuxServer.io team brings you another container release featuring easy user mapping and community support. Find us for support at:
#linuxserver.io[
][hub][
][hub]
[hub]: https://hub.docker.com/r/linuxserver/letsencrypt/
This container sets up an Nginx webserver and reverse proxy with php support and a built-in letsencrypt client that automates free SSL server certificate generation and renewal processes. It also contains fail2ban for intrusion prevention.
[
][letsurl]
[letsurl]: https://letsencrypt.org/
docker create \
--privileged \
--name=letsencrypt \
-v <path to data>:/config \
-e PGID=<gid> -e PUID=<uid> \
-e EMAIL=<email> \
-e URL=<url> \
-e SUBDOMAINS=<subdomains> \
-p 443:443 \
-e TZ=<timezone> \
linuxserver/letsencrypt
The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side. For example with a port -p external:internal - what this shows is the port mapping from internal to external of the container. So -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 http://192.168.x.x:8080 would show you what's running INSIDE the container on port 80.
-p 443 - the port(s)-v /config - all the config files including the webroot reside here-e EMAIL - your e-mail address for cert registration-e URL - the top url you have control over ("customdomain.com" if you own it, or "customsubdomain.ddnsprovider.com" if dynamic dns)-e SUBDOMAINS - subdomains you'd like the cert to cover (comma separated, no spaces) ie. www,ftp,cloud-e PGID for GroupID - see below for explanation-e PUID for UserID - see below for explanation-e TZ - timezone ie. America/New_YorkOptional settings:
-e DHLEVEL - dhparams bit value (default=2048, can be set to 1024 or 4096)-p 80 - Port 80 forwarding is optional (cert validation is done through 443)-e ONLY_SUBDOMAINS - if you wish to get certs only for certain subdomains, but not the main domain (main domain may be hosted on another machine and cannot be validated), set this to trueIt is based on alpine linux with s6 overlay, for shell access whilst the container is running do docker exec -it letsencrypt /bin/bash.
Sometimes when using data volumes (-v flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user PUID and group PGID. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™.
In this instance PUID=1001 and PGID=1001. To find yours use id user as below:
$ id <dockeruser>
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
yoursubdomain.duckdns.org and the subdomains can be www,ftp,clouddocker exec -it letsencrypt htpasswd -c /config/nginx/.htpasswd <username>Shell access whilst the container is running: docker exec -it letsencrypt /bin/bash
To monitor the logs of the container in realtime: docker logs -f letsencrypt
container version number
docker inspect -f '{{ index .Config.Labels "build_version" }}' letsencrypt
docker inspect -f '{{ index .Config.Labels "build_version" }}' linuxserver/letsencrypt
Content type
Image
Digest
Size
58.7 MB
Last updated
about 9 years ago
docker pull icetail/docker-letsencrypt