All Projects → JonasAlfredsson → docker-nginx-certbot

JonasAlfredsson / docker-nginx-certbot

Licence: MIT license
Automatically create and renew website certificates for free using the Let's Encrypt certificate authority.

Programming Languages

shell
77523 projects
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to docker-nginx-certbot

Certify
SSL Certificate Manager UI for Windows, powered by Let's Encrypt. Download from certifytheweb.com
Stars: ✭ 1,075 (+192.92%)
Mutual labels:  letsencrypt, ssl, https, acme, ssl-certificates
Docker Letsencrypt Certgen
Docker image to generate, renew, revoke RSA and/or ECDSA SSL certificates from LetsEncrypt CA using certbot and acme.sh clients in automated fashion
Stars: ✭ 64 (-82.56%)
Mutual labels:  letsencrypt, ssl, https, certbot, ssl-certificates
Certbot Route53
Helping create Let's Encrypt certificates for AWS Route53
Stars: ✭ 159 (-56.68%)
Mutual labels:  letsencrypt, ssl, certbot, ssl-certificates
Crypt Le
Crypt::LE - Let's Encrypt / Buypass / ACME client and library in Perl for obtaining free SSL certificates (inc. generating RSA/ECC keys and CSRs). HTTP/DNS verification is supported out of the box, easily extended with plugins, easily dockerized.
Stars: ✭ 277 (-24.52%)
Mutual labels:  ssl, https, acme, ecdsa
Pebble
A miniature version of Boulder, Pebble is a small RFC 8555 ACME test server not suited for a production certificate authority. Let's Encrypt is hiring! Work on Pebble with us.
Stars: ✭ 359 (-2.18%)
Mutual labels:  letsencrypt, https, acme, certificate-authority
Pric
Simple zero-config tool to create Private Certificate Authority & issue locally-trusted development server certificates with any domain names you'd like. SSL certificates for development purposes.
Stars: ✭ 87 (-76.29%)
Mutual labels:  ssl, https, certificate-authority, localhost
Serverpilot Letsencrypt
Automate the installation of Let's Encrypt SSL on the free plan of ServerPilot
Stars: ✭ 129 (-64.85%)
Mutual labels:  letsencrypt, ssl, https, certbot
Certes
A client implementation for the Automated Certificate Management Environment (ACME) protocol
Stars: ✭ 357 (-2.72%)
Mutual labels:  letsencrypt, ssl, https, ssl-certificates
Localdots
HTTPS domains for localhost. 🏠
Stars: ✭ 486 (+32.43%)
Mutual labels:  https, acme, localhost, ssl-certificates
Greenlock
Automatic SSL renewal for NodeJS
Stars: ✭ 30 (-91.83%)
Mutual labels:  letsencrypt, ssl, https, acme
Ansible Role Certbot
Ansible Role - Certbot (for Let's Encrypt)
Stars: ✭ 477 (+29.97%)
Mutual labels:  letsencrypt, ssl, https, certbot
Letscertbot
Let's Certbot is a tool builds automated scripts base on Certbot for obtaining, renewing, deploying SSL certificates.
Stars: ✭ 84 (-77.11%)
Mutual labels:  letsencrypt, acme, certbot, ssl-certificates
Acme client
Java ACME Client application
Stars: ✭ 77 (-79.02%)
Mutual labels:  letsencrypt, ssl, https, acme
Certificaat
General-purpose ACME client
Stars: ✭ 88 (-76.02%)
Mutual labels:  letsencrypt, ssl, https, acme
Acmetool
🔒 acmetool, an automatic certificate acquisition tool for ACME (Let's Encrypt)
Stars: ✭ 1,882 (+412.81%)
Mutual labels:  letsencrypt, ssl, acme
Sewer
Let's Encrypt(ACME) client. Python library & CLI app.
Stars: ✭ 131 (-64.31%)
Mutual labels:  letsencrypt, acme, certbot
wat
WAT - Windows ACME Tool
Stars: ✭ 28 (-92.37%)
Mutual labels:  letsencrypt, acme, certbot
Nginxconfig.io
⚙️ NGINX config generator on steroids 💉
Stars: ✭ 14,983 (+3982.56%)
Mutual labels:  letsencrypt, ssl, https
TestAuthority
Simple certificate authority for development written in C#. Allows issue of SSL certificates, including wildcard certificates
Stars: ✭ 32 (-91.28%)
Mutual labels:  ssl, certificate-authority, wildcard-certificates
Manuale
A fully manual Let's Encrypt/ACME client
Stars: ✭ 201 (-45.23%)
Mutual labels:  letsencrypt, ssl, acme

docker-nginx-certbot

Automatically create and renew website SSL certificates using the Let's Encrypt free certificate authority and its client certbot. Built on top of the official Nginx Docker images (both Debian and Alpine), and uses OpenSSL/LibreSSL to automatically create the Diffie-Hellman parameters used during the initial handshake of some ciphers.

ℹ️ The very first time this container is started it might take a long time before it is ready to respond to requests. Read more about this in the Diffie-Hellman parameters section.

ℹ️ Please use a specific tag when doing a Docker pull, since :latest might not always be 100% stable.

Noteworthy Features

Acknowledgments and Thanks

This container requests SSL certificates from Let's Encrypt, with the help of their certbot script, which they provide for the absolutely bargain price of free! If you like what they do, please donate.

This repository was originally forked from @henridwyer by @staticfloat, before it was forked again by me. However, the changes to the code has since become so significant that this has now been detached as its own independent repository (while still retaining all the history). Migration instructions, from @staticfloat's image, can be found here.

Usage

Before You Start

  1. This guide expects you to already own a domain which points at the correct IP address, and that you have both port 80 and 443 correctly forwarded if you are behind NAT. Otherwise I recommend DuckDNS as a Dynamic DNS provider, and then either search on how to port forward on your router or maybe find it here.

  2. I suggest you read at least the first two sections in the Good to Know documentation, since this will give you some important tips on how to create a basic server config, and how to use the Let's Encrypt staging servers in order to not get rate limited.

  3. I don't think it is necessary to mention if you managed to find this repository, but you will need to have Docker installed for this to function.

Available Environment Variables

Required

  • CERTBOT_EMAIL: Your e-mail address. Used by Let's Encrypt to contact you in case of security issues.

Optional

  • DHPARAM_SIZE: The size of the Diffie-Hellman parameters (default: 2048)
  • ELLIPTIC_CURVE: The size/curve of the ECDSA keys (default: secp256r1)
  • RENEWAL_INTERVAL: Time interval between certbot's renewal checks (default: 8d)
  • RSA_KEY_SIZE: The size of the RSA encryption keys (default: 2048)
  • STAGING: Set to 1 to use Let's Encrypt's staging servers (default: 0)
  • USE_ECDSA: Set to 0 to have certbot use RSA instead of ECDSA (default: 1)

Advanced

  • CERTBOT_AUTHENTICATOR: The authenticator plugin to use when responding to challenges (default: webroot)
  • CERTBOT_DNS_PROPAGATION_SECONDS: The number of seconds to wait for the DNS challenge to propagate (default: certbot's default)
  • DEBUG: Set to 1 to enable debug messages and use the nginx-debug binary (default: 0)
  • USE_LOCAL_CA: Set to 1 to enable the use of a local certificate authority (default: 0)

Volumes

  • /etc/letsencrypt: Stores the obtained certificates and the Diffie-Hellman parameters

Run with docker run

Create your own user_conf.d/ folder and place all of you custom server config files in there. When done you can just start the container with the following command (available tags):

docker run -it -p 80:80 -p 443:443 \
           --env [email protected] \
           -v $(pwd)/nginx_secrets:/etc/letsencrypt \
           -v $(pwd)/user_conf.d:/etc/nginx/user_conf.d:ro \
           --name nginx-certbot jonasal/nginx-certbot:latest

You should be able to detach from the container by holding Ctrl and pressing p + q after each other.

As was mentioned in the introduction; the very first time this container is started it might take a long time before before it is ready to respond to requests, please be a little bit patient. If you change any of the config files after the container is ready, you can just send in a SIGHUP to tell the scripts and Nginx to reload everything.

docker kill --signal=HUP <container_name>

Run with docker-compose

An example of a docker-compose.yaml file can be found in the examples/ folder. The default parameters that are found inside the nginx-certbot.env file will be overwritten by any environment variables you set inside the .yaml file.

NOTE: You can use both environment: and env_file: together or only one of them, the only requirement is that CERTBOT_EMAIL is defined somewhere.

Like in the example above, you just need to place your custom server configs inside your user_conf.d/ folder beforehand. Then you start it all with the following command.

docker-compose up

Build It Yourself

This option is for if you make your own Dockerfile. Check out which tags that are available in this document, or on Docker Hub, and then choose how specific you want to be.

In this case it is possible to completely skip the user_conf.d/ folder and just write your files directly into Nginx's conf.d/ folder. This way you can replace the files I have built into the image with your own. However, if you do that please take a moment to understand what they do, and what you need to include in order for certbot to continue working.

FROM jonasal/nginx-certbot:latest
COPY conf.d/* /etc/nginx/conf.d/

Tests

We make use of BATS to test parts of this codebase. The easiest way to run all the tests is to execute the following command in the root of this repository:

docker run -it --rm -v "$(pwd):/workdir" ffurrer/bats:latest ./tests

More Resources

Here is a collection of links to other resources that provide useful information.

  • Good to Know
    • A lot of good to know stuff about this image and the features it provides.
  • Changelog
    • List of all the tagged versions of this repository, as well as bullet points to what has changed between the releases.
  • DockerHub Tags
    • All the tags available from Docker Hub.
  • Advanced Usage
    • Information about the more advanced features this image provides.
  • Certbot Authenticators
    • Information on the different authenticators that are available in this image.
  • Nginx Tips
    • Some interesting tips on how Nginx can be configured.

External Guides

Here is a list of projects that use this image in various creative ways. Take a look and see if one of these helps or inspires you to do something similar:

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].