Skip to content

Should you wish to migrate from Certbot to (I personally prefer these days):

Revoking and Deleting Certbot Certificate

First comment out the certificate lines in the Nginx config file then reload Nginx.

Find the name of the most recent certificate. Eg, for my domain of

sudo ls -la /etc/letsencrypt/live/

The files here will be links. Make a note of the file that it links to. In my case, it links to a file called cert6.pem

Revoke with the following command. It will also ask if you want to delete. Select yes.

sudo certbot revoke --cert-path /etc/letsencrypt/archive/


Change to root with:

sudo su -

And install with:

curl | sh

To upgrade

~/ --upgrade

Setting up the DNS API

This allows you to use DNS verification when issuing certificates.

Make sure you are still root.

Create the key and email variables that relate to your Cloudflare account. When a certificate is ussued afterwards, these credentials are automatically written to a file an will be used automatically in future.

The token is usually within the DNS providers web console. The instructions vary from provider to provider but the instructions for them all can be found at

Issuing a Certificate

Issue an RSA certificate and install to a custom location

~/ --issue --dns dns_cloudns -d -d --keylength 4096 --key-file /etc/letsencrypt/rsa-certs/ --ca-file /etc/letsencrypt/rsa-certs/ --cert-file /etc/letsencrypt/rsa-certs/ --fullchain-file /etc/letsencrypt/rsa-certs/ --pre-hook "mkdir -p /etc/letsencrypt/rsa-certs/" --post-hook "find /etc/letsencrypt/rsa-certs/ -name '*.pem' -type f -exec chmod 600 {} \;" --renew-hook "find /etc/letsencrypt/rsa-certs/ -name '*.pem' -type f -exec chmod 600 {} \; -exec service nginx reload \;"

and issue an ECC certificate

~/ --issue --dns dns_cloudns -d -d --keylength ec-384 --key-file /etc/letsencrypt/ecc-certs/ --ca-file /etc/letsencrypt/ecc-certs/ --cert-file /etc/letsencrypt/ecc-certs/ --fullchain-file /etc/letsencrypt/ecc-certs/ --pre-hook "mkdir -p /etc/letsencrypt/ecc-certs/" --post-hook "find /etc/letsencrypt/ecc-certs/ -name '*.pem' -type f -exec chmod 600 {} \;" --renew-hook "find /etc/letsencrypt/ecc-certs/ -name '*.pem' -type f -exec chmod 600 {} \; -exec service nginx reload \;"

The above commands also take of creating the custom directory, setting the permissions, and reloading Nginx