How to Use to Provision LetsEncrypt SSL Certificates

LetsEncrypt has changed the face of SSL certification issuance. Making it easy for website developers to freely and easily issue an SSL certificate, LetsEncrypt has opened the floodgate to properly securing every website. A service is often only as good as its tools and an open-source project that has gained traction is the shell utility.

There are three functional steps in retrieving an SSL certificate from LetsEncrypt, requesting the certificate, verifying that the requestor is authorized, and issuing the certificate. makes all three of these steps easy, offering flexibility in what type of certificates are requested and how they are verified.

Installing on Ubuntu

There are two main ways to install In this example, we are installing the utility to a recent version of Ubuntu. is written in the common Unix sh language, therefore it can be run on virtually every flavor of Linux and Mac OS X, even Windows with the right Cygwin setup!

Installation via the Web

This is the easiest method of installation, you can quickly install and get started with configuring. Some folks may not be comfortable with this due to directly installing from the internet.

Installation via Git

If installing the utility directly from the web is not preferred, you can use git to clone the repository and run the installation from there.

Either method will perform the following three actions. Technically, all three can be done individually, if desired but the installation script makes this quick and easy.

  1. Create and copy to your home dir ($HOME): ~/ All certs will be placed in this folder too.
  2. Create alias for:
  3. Create daily cron job to check and renew the certs if needed.

Read on to learn how to issue a certificate using both the traditional file-based method and the DNS based method.

Issuing, Renewing, and Removing an SSL Certificate

There are multiple methods and ways to issue an SSL certificate using, but we are going to look at two common and easy to use methods, file-based, and DNS based. First, let’s look at the most common method below. This will request a certificate with an additional wildcard subject-alternate name (SAN) entry of *.[](<>). Why would you want both versions? If your site responds to both and, then you will want a certificate that satisfies both requests. Otherwise, the second request will fail, leading to a poor user experience.

An example NGINX configuration is below, using the file-based .well-known folder. This will allow NGINX to respond to SSL authorization requests. must have writeable access to this folder.

This can be a standalone *.conf file that is included in the server configuration block of a NGINX vhost file.

The second method is to use a DNS provider, such as Cloudflare which is demoed below, to verify ownership of the domain. You will need to define an ~\\\\account.conf file with the following values.

Once the account.conf file has been created you can issue a near-identical command from above, but using the --dns dns_cf option. This will create a temporary txt DNS record that will be used by LetsEncrypt and to verify ownership of the domain.

SSL Certificate Renewals

The cron job that creates upon installation will also take care of renewals. There is no need to do anything, but if you need to force a renewal you can do so like below.

Removing an SSL Certificate from Renew List

An SSL certificate will cease to validate when the certificate is not removed, to prevent from doing so, you can issue the following command.

This will not remove the certificate stored on disk, in the same directory as, so you will need to remove that yourself.


LetsEncrypt and make retrieving and managing SSL certificates quick and easy. Using the familiar command-line shell interface that many system administrators are used to, using could not be easier. Secure your websites today!


Don't have a login but want to join the conversation? Sign up for a Petri Account

Entrepreneur, hustler, husband, dad, Automator, content producer, published author, Microsoft MVP, DevOps pro and passionate problem-solver.