These script files are meant to be used in conjunction with certbot for deploying TLS certificates to various services not covered by a reverse proxy.
Depending on your system's configuration there are two ways to use these, either globally, or per-domain/account.
See this forum post for more information.
- Create
/etc/letsencrypt/renewal-hooks/deploy
- Add any of these scripts to that folder
- Mark them as executable (
chmod +x *.sh
) - Fire off a renewal or in
run
mode and Certbot will automatically run the scripts (certbot renew
orcertbot run
)
- Place the script somewhere that
certbot
can access (usually runs as root) - Re-run
certbot
with--deploy-hook
pointing to the script in question and force a new certificate
- Edit
/etc/letsencrypt/renewal/<domain>.conf
and addrenew_hook = /path/to/hook.sh
in the[renewalparms]
section under theaccount =
line - Run the hook while setting RENEWED_LINEAGE and RENEWED_DOMAIN to the live cert path and domain name respectively:
RENEWED_LINEAGE=/etc/letsencrypt/live/<domain> RENEWED_DOMAIN=<domain> /path/to/hook.sh
- Create
/etc/letsencrypt/specific-hooks
- Under that new folder, create separate folders for each domain.
- Add the hook scripts to those separate domain folders under
specific-hooks
- Copy
_run-hooks.sh
to thespecific-hooks
folder and name it after:<domain>-run-hooks.sh
and edit the file accordingly to point to your path for each domain's hooks. Make sure to mark it as executable:chmod +x <domain>-run-hooks.sh
- Follow the single hook instructions but substitute the single hook with the
<domain>-run-hooks.sh
script.