Skip to content

Instantly share code, notes, and snippets.

@ramboldio
Last active September 9, 2021 16:16
Show Gist options
  • Save ramboldio/3bcc25e5e5192844670a757f2783f5ff to your computer and use it in GitHub Desktop.
Save ramboldio/3bcc25e5e5192844670a757f2783f5ff to your computer and use it in GitHub Desktop.
Run Certbot in Docker
#!/bin/bash
# this folder needs to exist
mkdir ~/certs
# authenticate yourself (requires that nothing runs on ports 443 and 80)
docker run --rm -it -v ~/certs:/etc/letsencrypt -p 443:443 certbot/certbot certonly --authenticator standalone
# renewal
docker run --rm -it -v ~/certs:/etc/letsencrypt certbot/certbot renew
@ricardojlrufino
Copy link

for renew i need:
docker run --rm -it -p 443:443 -p 80:80 -v /etc/letsencrypt:/etc/letsencrypt certbot/certbot renew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment