How to secure Plesk with Let's Encrypt certificate via CLI

Created:

2017-07-11 00:13:54 UTC

Modified:

2017-08-16 17:05:49 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to secure Plesk with Let's Encrypt certificate via CLI

Applicable to:

  • Plesk for Linux

Question

How to install Let's Encrypt SSL certificate via command line?

Answer

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:

  1. Connect to the server using SSH .
  2. Create a certificate for your hostname:

    # plesk bin extension --exec letsencrypt cli.php -d example.com -d www.example.com -m admin@example.com

    Note: remove -d www.example.com if the domain does not have www prefix.

  3. Set the certificate as default for Plesk login:

    # plesk bin server_pref -u -panel-certificate  "Lets Encrypt example.com" -certificate-repository example.com

  4. 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

Have more questions? Submit a request
Please sign in to leave a comment.