Generating a certificate with Let's Encrypt

Let’s Encrypt is a free, automated, and open certificate authority (CA) that allows website owners to install digital certificates free of charge.

Follow the steps below to install ACME client and generate the SSL certificate.

ssh [email protected]
git clone https://github.com/kelunik/acme-client
cd acme-client
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"; php composer-setup.php; php -r "unlink('composer-setup.php');"; php composer.phar install --no-dev
php bin/acme setup --server letsencrypt --email [email protected]

php bin/acme issue --domains domain.com:www.domain.com --path /home/username/public_html:/home/username/public_html --server letsencrypt

# Cert Generated at
cd /home/username/acme-client/data/certs/acme-v01.api.letsencrypt.org.directory/domain.com

You can check the certificate validity using this command:

php bin/acme check --name domain.com --server letsencrypt
Certificate is valid until 18.04.2017

The command below can be used to reissue the certificate:

php acme-client/bin/acme issue --domains domain.com:www.domain.com --path /home/username/public_html:/home/username/public_html --server letsencrypt

You may setup a cron job to renew the certificate automatically.

Note

You will need to replace domain.com, [email protected] and username with your actual domain name, email address and username.