Letsencrypt commands for beginners

letsencrypt commands for beginners

Letsencrypt commands for beginners

./certbot-auto certificates: This commands lists down all the letsencrypt certificates (both active and expired) with exact path details where the certificate exists.

./certbot-auto certonly -a standalone: This command helps to create a new ssl certificate, if you want to create for more than one domain then enter the domain names with comma.

./letsencrypt-auto renew: This command renews all your existing letsencrypt certificates. This blog explain in detail about the letsencrypt certificate renewal process and stuffs.

./certbot-auto delete: This will list down the certificates installed and asks the prompt for certificate deletion.

cd /letsencrypt/letsencrypt: Default path in centos/AWS machines, once the letsencrypt is installed.

./letsencrypt-auto certonly –webroot -w /usr/share/nginx/html -d ngdeveloper.com -d www.ngdeveloper.com

This command creates the certificates in auto mode for both ngdeveloper.com and www.ngdeveloper.com

How to add new domain ?

./certbot-auto certonly -d dev.saveji.com

How to create same certificate for multiple subdomains ?

sudo ./certbot-auto certonly –standalone -d ngdeveloper.com,www.ngdeveloper.com,api.ngdeveloper.com,admin.ngdeveloper.com,mirthbees.ngdeveloper.com,beta.ngdeveloper.com

This will install the same certificate with all these subdomains and prints something below to this:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for beta.ngdeveloper.com
http-01 challenge for mirthbees.ngdeveloper.com
Waiting for verification…
Cleaning up challenges

IMPORTANT NOTES:
– Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/ngdeveloper.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/ngdeveloper.com/privkey.pem
Your cert will expire on 2019-10-04. To obtain a new or tweaked
version of this certificate in the future, simply run certbot-auto
again. To non-interactively renew *all* of your certificates, run
“certbot-auto renew”
– If you like Certbot, please consider supporting our work by:

Donating to ISRG / Let’s Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le

[ec2-user@ip-172-31-44-200 letsencrypt]$ sudo ./certbot-auto certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Found the following certs:
Certificate Name: ngdeveloper.com
Domains: ngdeveloper.com admin.ngdeveloper.com api.ngdeveloper.com beta.ngdeveloper.com mirthbees.ngdeveloper.com www.ngdeveloper.com
Expiry Date: 2019-10-04 05:49:31+00:00 (VALID: 89 days)
Certificate Path: /etc/letsencrypt/live/ngdeveloper.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/ngdeveloper.com/privkey.pem
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

Leave a Reply