How To Install the Webmin Control Panel on an Ubuntu 18.04 VPS or Dedicated Server

Webmin is a server control panel that lets you manage your server using a sleek modern interface. With it, you’ll be able to adjust to a myriad of settings as well as manage users/groups and software packages. In this tutorial, we’re going to install Webmin, do some basic configuration, and then secure access to the control panel.

Before going through the steps in this article, there are a couple of things to make sure of.  First, make sure your LAMP stack has been installed and is running correctly. You should at least be able to get to the default Ubuntu index page on Apache and phpinfo() should be returning valid output.

Additionally, make sure to have a fully qualified domain name as we’re going to be securing our Webmin Panel using a certificate from Let’s Encrypt.

Installing Webmin

  1. Add the Webmin Repository to the sources.list File
    sudo nano /etc/apt/sources.list

    Add the following to the bottom and save the file then exit:

    deb http://download.webmin.com/download/repository sarge contrib
  2. Add Webmin’s PGP Key
    wget http://www.webmin.com/jcameron-key.asc
    sudo apt-key add jcameron-key.asc
  3. Update the List of Packages Now That Webmin is Included
    sudo apt update
  4. Install Webmin
    sudo apt install webmin

Securing Webmin

At this point, Webmin is running but you have to reference port 10000 on the IP/domain. We’re going to install a TSL/SSL certificate from Let’s Encrypt and use Apache to proxy requests to Webmin on port 10000.

  1. Create a New Apache Virtual Host File
    sudo nano /etc/apache2/sites-available/yourdomainname.conf
  2. Add the Following Text to the New File Then Save and Close the File
    <VirtualHost *:80>
            ServerAdmin YourEmailAddress
            ServerName YourDomainName
            ProxyPass / http://localhost:10000/
            ProxyPassReverse / http://localhost:10000/
    </VirtualHost>
  3. Open Webmin’s miniserv.conf File
    sudo nano /etc/webmin/miniserv.conf
  4. Locate the Line
    ssl=1

    and Change It to

    ssl=0

    then Save and Close the File.

  5. Open the Webmin Config File
    sudo nano /etc/webmin/config
  6. Add the Following Line to the Bottom of the File:
    referers=YourDomainName
  7. Restart Webmin
    sudo systemctl restart webmin
  8. Enable Apache’s proxy_http Module
    sudo a2enmod proxy_http
  9. Enable the Virtual Host
    sudo a2ensite YourDomainName
  10. Restart Apache
    sudo systemctl restart apache2
  11. Create Your Security Certificate
    sudo certbot --apache --email YourEmailAddress -d YourDomainName --agree-tos --redirect --noninteractive

    You should see some output indicating that you have successfully enabled https://YourDomainName.

Conclusion

Webmin is now installed, running, and you’ve secured the control panel.

As soon as you log in you will be on the Dashboard where you can get a quick overview of system health and see critical information such as update notifications. Use the left-hand menu to explore all the different tasks Webmin makes easier.

Check out the top 3 cPanel hosting services:

Was this article helpful?