Created
March 2, 2022 22:12
-
-
Save jonathanvanschenck/c5004f2d8976bb5e557de04fa4fd2493 to your computer and use it in GitHub Desktop.
Certbot webroot with docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nginx configuration | |
server { | |
listen 80; | |
location /.well-known/acme-challenge/ { | |
root /var/www/letsencrypt; | |
} | |
... | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -it --rm --name cerbot \ | |
-v "/etc/letsencrypt:/etc/letsencrypt" \ | |
-v "/var/www/letsencrypt:/var/www/letsencrypt" \ | |
# https://eff-certbot.readthedocs.io/en/stable/using.html#webroot | |
certbot/certbot certonly --webroot -v\ | |
-m [email protected] \ | |
-w /var/www/letsencrypt \ | |
-d your.domain.com | |
ls /etc/letsencrypt/live | |
# Then, update nginx with your domian: | |
# server { | |
# listen 443 ssl; | |
# .... | |
# ssl_certificate /etc/letsencrypt/live/your.domain.com/fullchain.pem; | |
# ssl_certificate_key /etc/letsencrypt/live/your.domain.com/key.pem; | |
# .... | |
# } | |
# Don't forget to reload nginx | |
# service nginx reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -it --rm --name cerbot \ | |
-v "/etc/letsencrypt:/etc/letsencrypt" \ | |
-v "/var/www/letsencrypt:/var/www/letsencrypt" \ | |
# https://eff-certbot.readthedocs.io/en/stable/using.html#webroot | |
certbot/certbot renew | |
# Don't forget to reload nginx | |
service nginx reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment