Interacting with certbot non-interactively

Command line parameters for the LetsEncrypt certbot script

The letsencrypt python script called cartbot does all the hard work for you, it can request a new certificate, renew existing certificates, revoke and delete certificates. It can do ths from the command line interactively, i.e. asking you questions when it needs to, or non-interactively so you can use it in scripts. Here are some useful commands in the non-interactive mode:

Revoke a certificate

certbot -n revoke --cert-path /etc/letsencrypt/live/www.example.com/cert.pem

Request a new certificate

certbot certonly -d www.g1fef.co.uk --webroot --webroot-path /path/to/web/docs/

Delete a certificate

certbot -n delete --cert-name www.example.com

Don’t forget to restart your webserver, especially after you revoke or delete a certificate!