Read the article about this script on the Flipping Binary website.
I've noticed an uptick in interest recently, but my time is devoted to other projects at the moment. If you make improvements that you want to share, please submit a pull request. I will probably approve it as long as it doesn't break anything and provides some sort of improvement.
Modify these steps and the scripts as necessary for your distribution. The steps have been tested only on Ubuntu 16.04 servers.
- Change ownership and permissions of the script files
$ sudo chown root:root letsencrypt-*
$ sudo chmod +x letsencrypt-*
- Change the settings in
letsencrypt-tlsafile, especially theEMAILsetting!
$ sudo nano letsencrypt-tlsa
- Move the
letsencrypt-tlsafile to/etc/defaultso it is accessible by the other scripts and easy to edit.
$ sudo mv letsencrypt-tlsa /etc/default
- Move
letsencrypt-autorunto/etc/cron.weekly
$ sudo mv letsencrypt-autorun /etc/cron.weekly
- Move the rest to
/usr/local/sbin
$ sudo mv letsencrypt-* /usr/local/bin
- Generate a key pair and Certificate Signing Request (CSR). This script does not limit the number of domain names, but attempting to generate one certificate for dozens of domains at a time might fail. The first listed domain is primary and needs to be listed first for each command in this set of tools. Using
example.comandwww.example.comas an example:
$ sudo letsencrypt-generate example.com www.example.com
- Request a signature from Let's Encrypt. Using
example.comandwww.example.comas an example both of these commands do the same thing (note the primary domain is listed first and is the only one that matters):
$ sudo letsencrypt-request example.com
$ sudo letsencrypt-request example.com www.example.com
- Check the hash of the signed certificate. You can list secondary domains along with the primary domain, but the hash will be the same for each. The important part includes and follows the
3 1 1which makes up your TLSA record. Usingexample.comandwww.example.comas an example:
$ sudo letsencrypt-hash example.com www.example.com
-
Publish the TLSA records with your DNS provider.
-
Install the new certificates. This command will create a symlink in a consistent location (defaulting to
/etc/ssl/letsencrypt/live/<domainname>) to the latest signed certificate for the primary domain. Usingexample.comandwww.example.comas an example, both of these commands do the same thing (note the primary domain is listed first and is the only one that matters):
$ sudo letsencrypt-install example.com
$ sudo letsencrypt-install example.com www.example.com