Install SSL certificates for free using letsencrypt on virtualmin GPL control panel

To be able to host websites with https capabilities, it is strongly recommended to use a certificate signed by a valid authority. Most companies charge somewhere between 4 and 400 Dollar/Euro for a signed SSL/TLS certificate. Then there are some free certificate authorities like StartSSL… But for not to long there now is a new player to the SSL game: Letsencrypt!

The upsides of letsencrypt are mainly that its 100% free and the biggest advantage it supports automated certificate signing!

Below a short but sweet tutorial to configure letsencrypt for certificate signing on a server with virtualmin GPL control panel.

If you are looking for a tutorial on how to setup your own webhosting server using virtualmin please see this tutorial

    1. Make a backup you fool!
    2. Update your  server
      – You can choose to do so by using virtualmin update manager or execute sudo yum update -y on Centos or sudo apt-get update && sudo apt-get upgrade -y on debian/ubuntu systems
    3. Install git
      – On Ubuntu: sudo apt-get install git
      – On Centos: sudo yum install git
    4. Clone letsencrypt
      git clone (REMEMBER WHERE YOU CLONED IT you will need that later)
    5. First time run to set email address
      – Execute ./letsencrypt/letsencrypt-auto -m [email protected]
      – After executing the script as described above, you will be asked to select domains for which you want to generate a certificate PLEASE DESELECT ALL DOMAINS (if generated trough command line it might mess up your apache config)
      – It does not matter if the script fails or stops responding, you can exit the script using CTRL+C
    6. Login to webmin and navigate to Webmin>Webmin Configuration and click on the SSL Encryption button
      – Select the Let`s Encrpt tab and click the module configuration button
      –  Fill in the path for the letsencrypt auto command, in our case /root/letsencrypt/letsencrypt-auto and click save configuration
    7. Navigate  to virtualmin and navigate to the domain for which you would like to issue the certificate
      –  Click on edit virtual server
      – On the enabled features section make sure “enable SSL website” is selected and click on  save virtual server.
    8. Click on: server configuration> manage ssl certificates and select the letsencrypt tab
      –  Click “request certificate
      –  PROFIT!