All Projects → ebarault → letsencrypt-autorenew-docker

ebarault / letsencrypt-autorenew-docker

Licence: other
letsencrypt certificate generation and cron enabled autorenewal as a docker image

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to letsencrypt-autorenew-docker

Chef Acme
Chef cookbook to request SSL certificates at Let's Encrypt
Stars: ✭ 98 (+66.1%)
Mutual labels:  letsencrypt, certificate
wat
WAT - Windows ACME Tool
Stars: ✭ 28 (-52.54%)
Mutual labels:  letsencrypt, certificate
Docker Nginx Gunicorn Flask Letsencrypt
Boilerplate code for setting up Nginx + Gunicorn + Flask + automated LetsEncrypt certificates (https) using docker-compose.
Stars: ✭ 117 (+98.31%)
Mutual labels:  letsencrypt, certificate
Acmesharp
An ACME client library and PowerShell client for the .NET platform (Let's Encrypt)
Stars: ✭ 1,161 (+1867.8%)
Mutual labels:  letsencrypt, certificate
Acme Nginx
python acme client for nginx
Stars: ✭ 248 (+320.34%)
Mutual labels:  letsencrypt, certificate
Acme client
Java ACME Client application
Stars: ✭ 77 (+30.51%)
Mutual labels:  letsencrypt, certificate
Node Acme Lambda
Use AWS Lambda to manage SSL certificates for ACME providers like Let's Encrypt.
Stars: ✭ 120 (+103.39%)
Mutual labels:  letsencrypt, certificate
Certbot Letencrypt Wildcardcertificates Alydns Au
certbot'renewing letencrypt certificate plugin - automatic verification aliyun/tencentyun/godaddy dns
Stars: ✭ 839 (+1322.03%)
Mutual labels:  letsencrypt, certificate
Acme Plugin
🔏 ACME protocol plugin for Ruby on Rails applications
Stars: ✭ 190 (+222.03%)
Mutual labels:  letsencrypt, certificate
Nginx Proxy Automation
Automated docker nginx proxy integrated with letsencrypt.
Stars: ✭ 2,302 (+3801.69%)
Mutual labels:  letsencrypt, certificate
Ansible Letsencrypt
Ansible role for LetsEncrypt
Stars: ✭ 66 (+11.86%)
Mutual labels:  letsencrypt, certificate
LetsEncrypt
C# layer for generation of wildcard Let's Encrypt SSL certificates
Stars: ✭ 67 (+13.56%)
Mutual labels:  letsencrypt, certificate
Ghost Nginx Ssl Docker
Ghost blog with nginx proxy, lets encrypt ssl in a docker-compose (ready for production)
Stars: ✭ 45 (-23.73%)
Mutual labels:  letsencrypt, certificate
Certificaat
General-purpose ACME client
Stars: ✭ 88 (+49.15%)
Mutual labels:  letsencrypt, certificate
Certbot
Certbot is EFF's tool to obtain certs from Let's Encrypt and (optionally) auto-enable HTTPS on your server. It can also act as a client for any other CA that uses the ACME protocol.
Stars: ✭ 28,541 (+48274.58%)
Mutual labels:  letsencrypt, certificate
Getssl
obtain free SSL certificates from letsencrypt ACME server Suitable for automating the process on remote servers.
Stars: ✭ 1,687 (+2759.32%)
Mutual labels:  letsencrypt, certificate
Ssl Certificate
A class to validate SSL certificates
Stars: ✭ 522 (+784.75%)
Mutual labels:  letsencrypt, certificate
Dehydrated
letsencrypt/acme client implemented as a shell-script – just add water
Stars: ✭ 5,261 (+8816.95%)
Mutual labels:  letsencrypt, certificate
Acmetool
🔒 acmetool, an automatic certificate acquisition tool for ACME (Let's Encrypt)
Stars: ✭ 1,882 (+3089.83%)
Mutual labels:  letsencrypt, certificate
qiniu-auto-cert
七牛 CDN 证书自动化工具
Stars: ✭ 20 (-66.1%)
Mutual labels:  letsencrypt, certificate

letsencrypt-autorenewal-docker

Available on dockerhub here.

This image runs certbot under the hood to automate issuance and renewal of letsencrypt certificates.

Initial certificate requests are run at container first launch, once the image responds on a specified health check url.

Then certificates validity is checked at 02:00 on every 7th day-of-month from 1 through 31, and certificates are renewed only if expiring in less that 28 days, preventing from being rate limited by letsencrypt.

Issued certificates are made available in the container's /certs directory which can be mounted on the docker host or as a docker volume to make them available to other applications.

Requirements

  • docker
  • docker-compose

Configure the image's run parameters

Adapt the provided docker-compose.yml file to fit your requirements. The required/optional parameters are described here after:

Build or fetch the docker image

Ports

The software in the docker container exposes internally the 443 port, which you should expose back on the docker host with no translation, such as in "443:443"

Volumes

The following volumes of interest can be mounted on the docker host or as docker volumes:

  • /certs : location of certificates generated by letsencrypt, this is the main directory of interest to expose to your application
  • /etc/letsencrypt : location of letsencrypt install dir (optional, for debug purposes)
  • /var/log/letsencrypt : location of letsencrypt logs (optional, for debug purposes)

Environment variables:

  • WEBROOT : (optional) path to the host's web server root. If provided, letsencrypt will use the given existing web server to request and validate the certificates. If not provided, letsencrypt will launch it's own web server for this purpose
  • PLUGIN : (optional, defaults to standalone) A certbot plugin to use (e.g. manual)
  • PREFERRED_CHALLENGES : (optional, defaults to http-01) A sorted, comma delimited list of the preferred challenge to use during authorization with the most preferred challenge listed first (eg. "dns" or "tls-alpn-01,http,dns"). NOTE: tls-alpn-01 challenge is yet not supported by certbot 0.31.0
  • CUSTOM_ARGS : (optional) Additional certbot command-line options (e.g. --redirect), refer to certbot documentation
  • LOGFILE : (optional) path of a file where to write the logs from the certificate request/renewal script. When not provided both stdout/stderr are directed to console which is convenient when using a docker log driver
  • DEBUG : (optional) whether to run letsencrypt in debug mode, refer to certbot documentation
  • STAGING : (optional) whether to run letsencrypt in staging mode, refer to certbot documentation
  • DOMAINS : space separated list of comma separated subdomains to register the certificate with, for example:
    • my.domain.com
    • sub.domain1.com,sub.domain2.com
    • my.other.domain.com sub.domain1.com,sub.domain2.com
  • EMAIL : email of the certificates supplicant
  • CONCAT : whether to concatenate the full chain of the certificate authority with the certificate's private key. This is required for example for haproxy. Otherwise the full chain and private key are kept in separate files which is required for example for nginx and apache
  • HEALTH_CHECK_URL : a publicly accessible health check url on which the software in the docker container can verify and wait for the docker host to be up and ready to accept connections

Example

As in the provided docker-compose.yml file, the expected configuration should look similar to this:

version: '2'

services:
  certbot:
    build: .
    # image: ebarault/letsencrypt-autorenew-docker:latest
    container_name: certbot
    ports:
      - "443:443"
    volumes:
      - ./certs:/certs
      - ./letsencrypt:/etc/letsencrypt
      - ./var_log_letsencrypt:/var/log/letsencrypt
    restart: always
    environment:
      # - WEBROOT=/path/to/web_root
      - LOGFILE=/var/log/letsencrypt/certrenewal.log
      - DEBUG=false
      - STAGING=false
      - DOMAINS=my.domain.com
      - [email protected]
      - CONCAT=false
      - HEALTH_CHECK_URL=my.domain.com:80

Docker Logs

When using a docker logging driver, the LOGFILE environment variable should not be set to make sure all the container logs (stdout/stderr) are directed to the console, and hence to the logging driver.

An example is provided for aws logging driver. This should be

version: '2'

services:
  certbot:
    # ...
    environment:
      # ...
      # LOGFILE should not be set when working with a docker logging driver
      # - LOGFILE=/var/log/letsencrypt/certrenewal.log
    logging:
      driver: "awslogs"
      options:
        awslogs-region: "${AWS_REGION}"
        awslogs-group: "hooly-search"
        awslogs-stream: "letsencrypt"

Build / run the container

Building

Build and run the container as follows:

docker-compose build
docker-compose up -d

Running image from dockerhub

docker-compose up -d
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].