SSL Login to webmin

Ubuntu 24, Apache server , Webmin 2.202

Hello.
This is my first time installing webmin on my ubuntu 24 VPS system.
I have a domain that I have used LetsEncrypt to add SSL , however, after that I decided to install Webmin. login into webmin using https://domain:10000 is not secure … how can i use the existing SSL for domain to secure Webmin access ?

I looked at many tutorial but yet they seems to be very confusing as how this process works.

so which version of virtualmin are you using ? if not it would have been better to install that and use it’s features to achieve your goal but in webmin setup there is an option for setting up a certificate for the system hostname, if that’s what you are trying to do

Thanks.
I only install Webmin … not virtualmin .
never used webmin before for managing servers before . version of webmin is 2.202 and is working , but login into the webmin is not picking up SSL that is installed for the domain …
as per instruction I use port 10000, but I saw port 10001 for SSL ? Not sure … but I am working on live site … so I thought I ask before modifying the firewall .

Which domain ? have you already setup some virtual servers manually and added ssl certificates please explain more at the moment i don’t quite understand what you are doing

Hello.
initially , I setup my ubuntu vps server , I Have Apache with 2 domain running and both domain secured using LetsEncrypt.
Decided for the first time to use webmin to administer the server. Followed the online instruction to install , which went great … however, login to webmin using https://mydomain:10000, is not secure.
I have SSL virtual host created by Certbot , listening on port 443 , so its obvious that port 10000 will not be secured using same certificate that is installed for my main domain .
so at this stage , login into webmin is not secure … and have no idea how i can request Certificate for the domain that Already got SSL Certificate just so I can secure both domain and port 10000 for webmin …
in virtual host i have added additional port <virtualhost *:443 *:10000> but that did not solve the problem . .
hope that helps …

Just add the certificate to /etc/miniserv.conf, look for the existing entries in the conf file and replace the file locations with the path to your existing certificate note webmin is not served by apache so changes there will make no difference.

Thanks.
how i can go about doing this ?
looking at the miniserv.conf I have 2 entries for the certificate …
userfile=/etc/webmin/miniserv.users
keyfile=/etc/webmin/miniserv.pem
i did create a self signed certificate directly from webmin before. thuse the miniserv.pem
replacing keyfile with LetsEncrypt file path , generates error and wont start webmin services. and no error info in journalctl that can tell me why webmin did not start .
Any info would be appreciate.

Thanks.
ps : LetsEncrypt created two file Fullchain.pem and privkey.pem…

A self signed cert will give this error in most browsers. But, does this not work for you?

That sounds like you did not do an install on a clean OS! :bomb: :boom:

Thanks.
I can not use LetsEncrypt in webmin to generate certificate as this certificate already exist and new cert , the operation fails in webmin …
Yes. I did not install webmin on clean server, this vps was up and running with apache, mysql, ssh, elasticsearch and magento , although is not public ( maintenance mode ) I see no reason why I can not setup SSL properly for webmin.
even though I get the message ( not secure ) on url … looking at Certificate detail , it shows that page has been encrypted and self signed certificate has been loaded. i added the certificate to the trusted certificate of my browser , but that didn’t work yet… I guess, i made the mistake on which pem file i should add.

I think this is a Webmin install, not Virtualmin. I don’t believe clean install matters here.

Have you tried the upload feature?

Don’t forget this is a webmin install not a virtualmin install things are different with a webmin install

That is there to install a certificate for the hostname and not a preexisting domain

Thanks.

I did upload of private and chain file , and that solved the problem . now i am using SSL that was issued by LetsEncrypt for a existing domain and secured the login

1 Like

They installed Webmin, which does not require a freshly installed OS. (If they want to manage websites, Virtualmin is the right tool for the job, rather than Webmin alone. But, since they just installed Webmin, they don’t have the “freshly installed OS” requirement.)

don’t forget to update it when the lets encrypt certificate expires

I know you already have received several solutions. :+1:

Just to let you know that I often spin up VPS systems without Webmin at first. Sometimes it’s just as easy to get a LAMP stack up and running, along with SSL via Apache certbot.

If you install Webmin afterwards, the following method has worked for me, at least with Debian based systems:
Your Apache Let’s Encrypt SSL certificate and key are normally saved at:
/etc/letsencrypt/live/your_domain.com/fullchain.pem
/etc/letsencrypt/live/your_domain.com/privkey.pem

Now, merge the two files into one .pem file to make managing this certificate easier:

cat /etc/letsencrypt/live/your_domain.com/fullchain.pem /etc/letsencrypt/live/your_domain.com/privkey.pem | tee /etc/webmin/letsencrypt.pem > /dev/null

Here, we’ve merged both the certificate file and the private key into one letsencrypt.pem file.

This file (letsencrypt.pem) should now be in the following webmin directory: /etc/webmin
Open the following file: /etc/webmin/miniserv.conf
Replace the following line: keyfile=/etc/webmin/miniserv.pem
With this: keyfile=/etc/webmin/letsencrypt.pem

Save and close the file. Restart Webmin: systemctl restart webmin
Wait for a few seconds while Webmin reboots, then refresh the page.
You’ll see that the Let’s Encrypt certificate is enabled and your connection is secured through HTTPS.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.