Created
January 26, 2019 10:00
-
-
Save askobara/7173c17e7e13594ea99c33c2c50141c4 to your computer and use it in GitHub Desktop.
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
# Staging | |
# Use this command for testing purpose, because of Let's Encrypt API restrictions | |
docker run -it --rm \ | |
-v certs:/etc/letsencrypt \ | |
-v certs-data:/data/letsencrypt \ | |
certbot/certbot \ | |
certonly --webroot \ | |
--register-unsafely-without-email --agree-tos \ | |
--webroot-path=/data/letsencrypt \ | |
--staging \ | |
-d <domain> | |
# Production | |
# When everything is fine and you are ready for production | |
docker run -it --rm \ | |
-v certs:/etc/letsencrypt \ | |
-v certs-data:/data/letsencrypt \ | |
certbot/certbot \ | |
certonly --webroot \ | |
--email <email> --agree-tos --no-eff-email \ | |
--webroot-path=/data/letsencrypt \ | |
-d <domain> | |
# Renew | |
# Add this command in your cron jobs | |
docker run -it --rm \ | |
-v certs:/etc/letsencrypt \ | |
-v certs-data:/data/letsencrypt \ | |
certbot/certbot \ | |
renew --webroot \ | |
--webroot-path=/data/letsencrypt \ | |
--quiet && docker kill --signal=HUP nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment