Certbot adding a domain | nginx | Ubuntu

First, install your certbot

apt-get install -y certbot

For Ubuntu, make sure you install the tool

apt-get install -y python-certbot-nginx

To add a domain

certbot –nginx -d yourdomainname.com -d www.yourdomainname.com

To revoke a domain

certbot –revoke –cert-path /etc/letsencrypt/live/MyDomain/fullchain.pem

Listing of certificates

certbot certificates

To test the renew

certbot renew –dry-run

To renew

certbot renew