How to secure Webmin in server that are running ISPConfig

Discussion in 'ISPConfig 3 Priority Support' started by Galopete, Mar 17, 2026.

  1. Galopete

    Galopete Member HowtoForge Supporter

    Hello to All.
    Wich is the best way to secure with let's encrypt an instance of Webmin in a server running ISPconfig?
    Thanks,
    Abraham.
     
  2. remkoh

    remkoh Well-Known Member HowtoForge Supporter

    Webmin operates completely separate from ISPconfig.

    Though you could use ISPconfig's main certificate in Webmin too.
    Set private key file to:
    Code:
    /usr/local/ispconfig/interface/ssl/ispserver.pem
    And under certificate file check "Same as private key".

    To restart Webmin too after certificate renewal copy file /usr/local/ispconfig/server/scripts/letsencrypt_renew_hook.sh into folder /usr/local/ispconfig/server/conf-custom/scripts/
    Delete lines 6 to 14 in the copied file:
    Code:
    ## If you need a custom hook file, create a file with the same name in
    ## /usr/local/ispconfig/server/conf-custom/scripts/
    ##
    ## End the file with 'return 124' to signal that this script should not terminate.
    if [ -e "/usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_renew_hook.sh" ]; then
      . /usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_renew_hook.sh
      ret=$?
      if [ $ret != 124 ]; then exit $ret; fi
    fi
    
    Create a new line after the last line containing "if rpm -q ..."
    Code:
    if rpm -q webmin; then service webmin restart; fi
    Create a new line after the last line containing "if [ "$(dpkg-query -W -f='${Status}' ..."
    Code:
    if [ "$(dpkg-query -W -f='${Status}' webmin 2>/dev/null | grep -c "ok installed")" -eq 1 ]; then service webmin restart; fi
    On the next certificate renewal webmin will also be restarted so it will use the renewed certificate.
     
    Last edited: Mar 18, 2026
    till likes this.
  3. Galopete

    Galopete Member HowtoForge Supporter

    Hi remkoh,
    Many thanks for the answer, i will try your suggestion and let you know the result.
    Abraham
     

Share This Page