Skip to content

Instantly share code, notes, and snippets.

@markshust
Last active November 4, 2017 12:00
Show Gist options
  • Select an option

  • Save markshust/ac5ddb553bb09b2d8e67967be34bc152 to your computer and use it in GitHub Desktop.

Select an option

Save markshust/ac5ddb553bb09b2d8e67967be34bc152 to your computer and use it in GitHub Desktop.
Let's Encrypt SSL certificate generation with Certbot and Docker
#replace foo.com and info@foo.com with your domain and email
docker run --rm -p 80:80 -p 443:443 -v $(pwd)/certs:/etc/letsencrypt certbot/certbot certonly -d foo.com --standalone -m info@foo.com --agree-tos
#create this cronjob to renew certificates
@daily docker run --rm -v $(pwd)/certs:/etc/letsencrypt certbot/certbot renew
#setup symlinks for use with nginx-proxy
ln -s ~/certs/live/foo.com/privkey.pem ~/certs/foo.com.key
ln -s ~/certs/live/foo.com/fullchain.pem ~/certs/foo.com.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment