Hi everyone,
I want to share my open source project letsencrypt-docker-compose that provides a Docker Compose project and a CLI configuration management tool to automatically obtain and renew free Let’s Encrypt SSL/TLS certificates and set up HTTPS in Nginx for multiple domain names.
Nginx is configured to support IPv4, IPv6, HTTP/1.1, HTTP/2, and optionally, WebSocket, and can be configured to serve static content, as a reverse proxy for a backend, or for PHP-FPM.
The project was released in 2020 and has been continuously improved since then. The CLI configuration management tool was added in 2023 to to make setup and usage as easy as possible.
The source code is available on GitHub.
Why was it created?
When using Kubernetes Let’s Encrypt SSL/TLS certificates can be easily obtained and installed using cloud native certificate management solutions.
For simple websites and applications, Kubernetes is too much overhead and Docker Compose is more suitable. Thus, this project was created to easily manage, install and auto-renew free SSL/TLS certificates with Docker Compose.
How it works?
There are three main services in the Docker Compose project:
nginx
,certbot
for obtaining and renewing certificates,cron
for triggering certificates renewal,
and one additional service cli
for interactive configuration.
Performing an initial setup using the CLI tool
Features
In addition to obtaining and automatically renewing SSL/TLS certificates, the following features are supported:
- Switching from staging to a Let’s Encrypt production environment;
- Adding new domains without downtime;
- Removing existing domains without downtime;
- Manually renewing all Let’s Encrypt certificates;
- Running on a local machine not directed to by DNS records;
- Advanced Nginx configuration.
Documentation is available on GitHub.
Here you go, no need to make simple things complicated.