Public | Automated Build

Last pushed: 2 years ago
Short Description
A docker service that registers and renews SSL certificates.
Full Description


A docker service that registers and renews SSL certificates with Let's Encrypt


If there is a server listening on port 80, it must proxy the following request to autossl port 13135.

GET ^/\.well-known/acme-challenge/([^/]+)$
location ~ ^/\.well-known/acme-challenge/([^/]+)$ {
  if ($request_method = GET) {
// node.js example - see test/bin/ for full example
const regex = new RegExp("^/\.well-known/acme-challenge/([^/]+)$")
if (regex.test(req.url) && req.method === 'GET') {
  proxy(req, res, '')

autossl will exit if it attempts registration and a server is listening on port 80, but the server is not proxying acme challenges to autossl.

To avoid a circular dependency wherein the server on port 80 needs certificates to startup and autossl needs a proxy on port 80 in order to register certificates, start autossl first. It will register certificates using port 80 if it is unused. Once registration is complete, start the other server on port 80.


docker run --rm -it --net host \
-e DOMAINS=",," \
-e EMAIL="" \
-v /etc/letsencrypt:/etc/letsencrypt \

# ssl_certificate     /etc/letsencrypt/live/
# ssl_certificate_key /etc/letsencrypt/live/

environment variables


Comma separated names to be registered.


The email address used for certificates.

AUTO=true true, false

true to schedule renewals to keep certificates up to date

false to register or renew certificates and exit

CRON_PATTERN=00 00 00 * * *

6 field cron pattern for renewal job.

Default is every night at midnight.


Bunyan log level

pass arguments to certbot

Manually call startup command and pass arguments for certbot

docker run pmkr/autossl startup --test-cert

responding to renewal

Run a script to watch the certificates or certificate directory for changes and respond.


To run tests:

npm run ca-server
# it's cruel, but sudo is needed so that the host can interact with files created by the container and to test proxy server on port 80.
sudo npm test
Docker Pull Command
Source Repository