Skip to content

Instantly share code, notes, and snippets.

@askobara
Created January 26, 2019 10:00
Show Gist options
  • Save askobara/7173c17e7e13594ea99c33c2c50141c4 to your computer and use it in GitHub Desktop.
Save askobara/7173c17e7e13594ea99c33c2c50141c4 to your computer and use it in GitHub Desktop.
# 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