- Plesk Onyx for Linux
How to install Let's Encrypt SSL certificate via command line?
By default, new Plesk installation is coming with pre-installed Let's Encrypt extension and if the server's hostname is correct, Plesk secures itself. Anyway, to do it manually in CLI you should have a correct hostname in OS and it should be resolved to your server. Do the following:
- Connect to the server using SSH .
Create a certificate for your hostname:
# plesk bin extension --exec letsencrypt cli.php -d example.com -d www.example.com -m email@example.com
Note: remove -d www.example.com if the domain does not have www prefix.
Set the certificate as default for Plesk login:
# plesk bin server_pref -u -panel-certificate "Lets Encrypt example.com" -certificate-repository example.com
Set the certificate as default for an IP address:
# plesk bin certificate --assign-cert "Lets Encrypt example.com" -domain example.com -ip 203.0.113.2