I answered that question in that thread, too. Custom actions with Virtualmin's Letsencypt renewals? - #4 by Joe
It doesn’t matter where you put it, as long as Virtualmin has the full path to find it in the command to run field.
I usually put this kind of thing in /usr/local/bin
or /usr/local/sbin
, but it doesn’t matter as long as you tell Virtualmin where to find it.