# Custom actions with Virtualmin's Letsencypt renewals?

**URL:** <https://forum.virtualmin.com/t/custom-actions-with-virtualmins-letsencypt-renewals/131248>\
**Category:** Virtualmin\
**Created:** [December 24, 2024, 9:18pm UTC](https://forum.virtualmin.com/t/custom-actions-with-virtualmins-letsencypt-renewals/131248 "2024-12-24T21:18:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [December 24, 2024, 10:09pm UTC](https://forum.virtualmin.com/t/custom-actions-with-virtualmins-letsencypt-renewals/131248/2 "2024-12-24T22:09:51Z")

</div>

> [@Brook](#):
>
> Or should I just look-up the standard letsencrypt guides and then Virtualmin will automatically pick up those commands?

Definitely not this. Virtualmin calls `certbot`, and then does stuff with the resulting certs, not the other way around.

[Virtualmin has pre and post hooks](https://www.virtualmin.com/docs/development/domain-management-api/), though, so you can write scripts in whatever language you like (including bash shell scripts) to run before or after changes. Renewing certs is a change, and the hook runs. To know if it’s a TLS cert change, you’d check for `SSL_DOMAIN`.

There’s an example of copying certs for a service not supported directly by Virtualmin here: [Domain Management API | Virtualmin — Open Source Web Hosting Control Panel](https://www.virtualmin.com/docs/development/domain-management-api/#update-ssl-certificate-for-prosody)

So, you could base your post script on that, and then configure Virtualmin to run it in Virtualmin Configuration-\>Actions upon server and user creation-\>Command to run after making changes to a server

---

_[View the full topic](https://forum.virtualmin.com/t/custom-actions-with-virtualmins-letsencypt-renewals/131248)._
