Enable LetsEncrypt via script/automation


I need to script enabling letsencrypt for a virtual server. Any pointers as to how to approach this? Thanks!



Howdy -- thanks for contacting us!

You'd first want to ensure that the "SSL Website" feature is enabled, which can be done with "virtualmin enable-feature" (run that command to see the options).

Next, you can use "virtualmin generate-letsencrypt-cert" to generate a Let's Encrypt certificate on the command line.

Thanks, I have managed to create a virtual server and enable letsencrypt in one go with this command:

virtualmin create-domain --domain some.domain.tld --web --ssl --letsencrypt --user test --pass test --desc "test" --unix --mail --dir