Skip to main content

CWP: How to add Lets Encrypt SSL certificate to Webmin

By default, Webmin uses a self-signed SSL certificate so your web browser will warn you that the connection is not secure. You can accept the self-signed SSL certificate and proceed to the log in screen. Let's replace it with a valid certificate from Let's Encrypt.

We have already generated Lets Encrypt SSL certificate for our Server FQDN using certbot. Please check the Let's Encrypt section for How to install Let's Encrypt for Server FQDN? Click Here

Open the configuration file and add the following :
# systemctl  stop  webmin
# vi /etc/webmin/miniserv.conf 

ssl=1
server=MiniServ/1.900
userfile=/etc/webmin/miniserv.users

keyfile=/etc/letsencrypt/live/host.datahead.biz/privkey.pem
certfile=/etc/letsencrypt/live/host.datahead.biz/fullchain.pem

For CWP:
keyfile=/etc/pki/tls/private/hostname.key
certfile=/etc/pki/tls/certs/hostname.bundle

# This will redirect from http to https
ssl_redirect=1 

Restart the Webmin Service:
# systemctl restart webmin
# systemctl status  webmin  -l
Now login to your server
http://host.datahead.biz:10000 
This non secure connection will redirect to https://host.datahead.biz:10000
Alternative Way:
# cd /etc/webmin
# mv miniserv.pem miniserv.pem.old
# cat /etc/letsencrypt/live/YOURDOMAIN/cert.pem /etc/letsencrypt/live/YOURDOMAIN/privkey.pem /etc/letsencrypt/live/YOURDOMAIN/chain.pem > /etc/webmin/miniserv.pem

Comments