A quick and easy to setup guide for getting TLS/SSL certificate expiry notifications using API or Email. You should already have a webserver and PHP installed before using this script.
Tested on Debian 13 on a fresh install.
Create a new directory in /var/www/html/TLSMonitor. After downloading all the files edit daily-tls-expiry-check.sh for adding your own notification types, for example Email, gotify, ntfy or social media APIs.
Install Sqlite3 apt install sqlite3
Download setup.sh curl https://raw.githubusercontent.com/saudiqbal/saudiqbal.github.io/refs/heads/main/files/TLSMonitor/setup.sh -o "/var/www/html/TLSMonitor/setup.sh"
Download daily-tls-expiry-check.sh curl https://raw.githubusercontent.com/saudiqbal/saudiqbal.github.io/refs/heads/main/files/TLSMonitor/daily-tls-expiry-check.sh -o "/var/www/html/TLSMonitor/daily-tls-expiry-check.sh"
Download index.php curl https://raw.githubusercontent.com/saudiqbal/saudiqbal.github.io/refs/heads/main/files/TLSMonitor/index.php -o "/var/www/html/TLSMonitor/index.php"
Give execution permission to the bash script chmod +x /var/www/html/TLSMonitor/setup.sh
And
Give execution permission to the bash script chmod +x /var/www/html/TLSMonitor/daily-tls-expiry-check.sh
Start the installation by running the command bash /var/www/html/TLSMonitor/setup.sh
To add or remove more domains or subdomains run the setup file again.
Crontab Setup
Add a cron job by editing cron crontab -e
Add new daily cron 0 0 * * * /bin/bash /var/www/html/TLSMonitor/daily-tls-expiry-check.sh > /dev/null 2>&1
Screenshot

Let me know if you have any comments or if there is any error in this guide.