Nginx Certbot Docker

nginx + certbot + docker-compose

Quick Intro: Generating SSLs using docker, docker-compose, Nginx & certbot.

Note: In a single certbot command it always generates a single certificate for all the domains listed inside.

# You may specify multiple domains with -d and obtain and
# install different certificates by running Certbot multiple times:
here is the doc

Here is the docker-compose file. Look at the command given to certbot that has multiple subdomains for which we need to generate the certificates for.

→ Use the below nginx.conf file to generate the certs:

→ Add the server blocks once generated as to the above conf file to use the SSLs and also the redirect.

→ Renew Certs

cat <(crontab -l) <(echo “@monthly docker-compose run — rm certbot renew”) | crontab -

Find my other articles @ my publication: ThinkSpecial

--

--

--

Recommended from Medium

Skipping a cutscene in Unity

Intro to C++ : Variables, Constants, & Data Types

Command AWS through CLI

A Beginner’s Guide to Authentication and Authorization in Strapi

Grill chicken FAQ

5 Sorting Algorithms for the Code Interviews

Direct connection to a docker container with SSH

2.5D Cert Req: Upgrading to URP

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gopi Krishna Kancharla

Gopi Krishna Kancharla

Director of Software Engineering @ CapitalOne-Garage

More from Medium

Auto Build & Push Docker Image to AWS ECR with Github Actions- [Step-By-Step]

How to manage and use Nginx Virtual host in Ubuntu

How to Setup Multiple Domains in Dedicated Hosting — Using Nginx and Docker Way

“Hello World” with Nginx Load Balancing.