PHPackages                             fridde/letsencrypt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fridde/letsencrypt

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fridde/letsencrypt
==================

A Fork of imbrish/letsencrypt to enable a simple cron task to update Let's Encrypt SSL certificates on shared hostings.

v0.6.4(7y ago)09GPL-3.0PHPPHP &gt;=5.4.0

Since Jan 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/fridde/letsencrypt)[ Packagist](https://packagist.org/packages/fridde/letsencrypt)[ Docs](https://github.com/imbrish/letsencrypt)[ RSS](/packages/fridde-letsencrypt/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (18)Used By (0)

letsencrypt
===========

[](#letsencrypt)

PHP script to automatically issue and renew [Let's Encrypt](https://letsencrypt.org/) SSL certificates on shared hostings.

Credits
-------

[](#credits)

Development of the script was inspired by [this article](https://neurobin.org/docs/web/fully-automated-letsencrypt-integration-with-cpanel/).

Checking, issuing and renewal of certificates is handled using [kelunik/acme-client](https://github.com/kelunik/acme-client).

Thanks to the authors!

Requirements
------------

[](#requirements)

- PHP 5.4 or higher
- Access to server via SSH
- Access to cPanel via UAPI

Installation
------------

[](#installation)

We will use [composer](https://getcomposer.org/) to easily install dependencies.

First connect to the server with SSH and then:

```
# Clone the repository
git clone https://github.com/imbrish/letsencrypt

# Navigate to repository folder
cd letsencrypt

# Install dependencies
composer install

# Create the config file, should be customized afterwards
cp config.yml.example config.yml

# Allow only owner to access the config
chmod 600 config.yml
```

Updating
--------

[](#updating)

To update the script to the newest version:

```
# Pull changes from the repository
git fetch
git reset --hard origin/master

# Install dependencies
composer install

# Optionally restore executable mode
chmod 775 bin/letsencrypt
```

Remember to review your configuration against `config.yml.example` for possible changes!

Configuration
-------------

[](#configuration)

All configuration should be placed in the `config.yml`:

```
# Server to use, "letsencrypt" and "letsencrypt:staging" are valid shortcuts.
# The latter can help when testing as it offers more lenient usage quotas.
server: letsencrypt

# Custom nameserver IP used by the "acme issue" command.
# For example Google public DNS "8.8.8.8" or "8.8.4.4", or Cloudflare 1.1.1.1.
nameserver: null

# Base directory of the certificate document roots.
home: /home/user

# List of certificates to issue and install, for each there are a few options:
# bits:    Number of bits for the domain private key, from 2048 to 4096.
# domains: Map of document roots to domains. Maps paths of challenge directories
#          to the domains for which certificate should be issued. The very first
#          domain will be the common name for the certificate and its directory.
certificates:
    # This is the first certificate, common name and directory will be example.com.
    # It will be issued for domains example.com and sub.example.com with www variants.
    # The challenge files go to /home/user/public_html and /home/user/sub/public_html.
    - bits: 4096
      domains:
        /public_html:
            - example.com
            - www.example.com
        /sub/public_html:
            - sub.example.com
            - www.sub.example.com
    # This is the second certificate, common name and directory will be another.com.
    # It will be issued for domain another.com with www variant. The challenge files
    # go to /home/user/another/public_html.
    - bits: 2048
      domains:
        /another/public_html:
            - another.com
            - www.another.com

# Renew a certificate if it is due to expire within so many days.
renew: 30

# E-mail to use for the Let's Encrypt registration. This e-mail will receive
# certificate expiration notices from Let's Encrypt.
email: me@example.com

# E-mail to notify about errors or certificates issued during the execution.
# Used only when command is called with a "-notify" or "-n" flag.
notify: me@example.com

# The cPanel user for which certificates should be installed.
# Necessary only when logged-in as a root.
user: null

# By default certificates will be installed in cPanel for all domains listed above.
# Domains can be filtered by a whitelist of names to accept and/or blacklist to reject.
# The www prefix should be omitted because it is trimmed before the installation.
install:
    whitelist:
    blacklist:
        - sub.example.com
```

Usage
-----

[](#usage)

Certificates can be issued/renewed by running the command manually.

Run script as an executable:

```
# Make the script executable
chmod 775 bin/letsencrypt

# Run it
bin/letsencrypt
```

Alternatively use PHP to execute the script:

```
php bin/letsencrypt
```

Script will check if certificates should be renewed and issue/reissue them if so. Then it will install newly issued certificates in all specified domains using cPanel API.

It can also notify you about actions it took via email, if you wish so.

Command line arguments:

OptionDescription`-n`, `--notify`Send email notification about errors or issued certificates`-c`, `--config`Name of the configuration file including extension, by default `config.yml``-v`, `--verbose`Enable verbose output`-h`, `--help`Display the help messageOptional list of certificate common names to issue and install only
 a subset of certificates defined in the configuration file.For example to use configuration file `example.yml`, issue and install only certificate for `example.com` and send email notification to the address defined in the config:

```
php bin/letsencrypt -c custom.yml -n -- example.com
```

Automation
----------

[](#automation)

Issuing, renewal and installation of certificates can be automated by setting up a cron job:

```
0 0 * * * /path/to/php-cli /home/user/letsencrypt/bin/letsencrypt -n

```

It will run the script every day at midnight and notify you about errors or issued certificates to an email defined in the configuration file.

You can check path to CLI version of PHP by connecting to your hosting via SSH and running:

```
which php
```

Alternatives
------------

[](#alternatives)

The [Neilpang/acme.sh](https://github.com/Neilpang/acme.sh) may be a more robust alternative.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Recently: every ~0 days

Total

17

Last Release

2881d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a3610e04a81465b118d75165c9d598bb88cc6412ed4d65f27d8c5defab56204?d=identicon)[fridde](/maintainers/fridde)

---

Top Contributors

[![imbrish](https://avatars.githubusercontent.com/u/8572846?v=4)](https://github.com/imbrish "imbrish (138 commits)")[![fridde](https://avatars.githubusercontent.com/u/772964?v=4)](https://github.com/fridde "fridde (3 commits)")

---

Tags

certificatesslletsencryptshared hosting

### Embed Badge

![Health badge](/badges/fridde-letsencrypt/health.svg)

```
[![Health](https://phpackages.com/badges/fridde-letsencrypt/health.svg)](https://phpackages.com/packages/fridde-letsencrypt)
```

###  Alternatives

[composer/ca-bundle

Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.

3.0k346.2M191](/packages/composer-ca-bundle)[acmephp/acmephp

Let's Encrypt client written in PHP

649155.1k](/packages/acmephp-acmephp)[kelunik/certificate

Access certificate details and transform between different formats.

10938.3M8](/packages/kelunik-certificate)[kelunik/acme

ACME library written in PHP.

121603.9k3](/packages/kelunik-acme)[afosto/yaac

Yet Another ACME client: a decoupled LetsEncrypt client

245500.4k1](/packages/afosto-yaac)[acmephp/core

Raw implementation of the ACME protocol in PHP

38973.7k7](/packages/acmephp-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
