How to Configure and Install Webmin on Ubuntu 18.04

How to install webmin on ubuntu

Webmin is a web-based control panel that is used for the administration of Linux systems. It is written in Perl and helps systems administrators to have an overview of their server performance at a glance.

Webmin eliminates the hassle of manually creating user accounts, groups, system update, configuring email, database, etc. In this tutorial, we will show you how you can install and secure Webmin on Ubuntu 18.04.


Before we get started, ensure you have the following in place

  • An instance of Ubuntu 18.04 server set up
  • Nginx webserver installed
  • A Fully Qualified Domain Name (FQDN) with the DNS A record pointing to the server's address.
  • Let's encrypt SSL installed using certbot

Let's now take a step by step approach and install webmin

Install webmin

To start off, we need to append Webmin's repository to enable us to seamlessly install and manage Webmin using the apt package manager. But before we do so, let's update our system repositories

$ sudo apt update

Next, install the necessary packages

$ sudo apt install python apt-show-versions libapt-pkg-perl libauthen-pam-perl libio-pty-perl libnet-ssleay-perl

Sample output

install webmin required packages

Thereafter, download the Webmin deb package

$ cd /tmp && curl -L -O
download webmin debian package

Now install Webmin using the command below

$ sudo dpkg -i webmin-current.deb
install and secure webmin on Ubuntu

Accessing Webmin

Not that we have successfully installed Webmin, we are going to allow port 10000 in the firewall. This is the port which we are going to access Webmin's interface.

To add port 10000 in ufw firewall execute

$ sudo ufw allow 10000/tcp


open webmin port

To verify that port 10000 is open, run

$ sudo ufw status


ufw status

With the port allowed in the firewall head out to your browser, and browse your domain with the suffix  :10000 at the end of the URL

webmin url not secure

The URL bar will show you that the site is not encrypted and the above page will open. This is because Webmin does not yet have an SSL certificate which we shall proceed to install.

To proceed to the main dashboard, click on the "Advanced"  tab and click on proceed to URL address

You will be presented with a login screen as shown. Enter the correct user details and click on 'Sign in'

webmin login page

The dashboard below will appear

webmin dashboard

Set up the document root directory

Next, we are going to configure Nginx server block. By default, Nginx has only one server block which is configured to server documents from /var/www/html directory

We are now going to set up a root directory for our site.


$ sudo mkdir -p /var/www/

With our directory in place, we are going to reassign ownership  to our regular user account

nbsp; sudo chown -R $USER:$USER /var/www/

Modify permissions

nbsp;sudo chmod -R 755 /var/www

Configure Nginx server block

Nginx contains one server block called default  by default which we can use as a template for our own configurations. Weare going to create our domain's server block and later copy the default server to it and make some modifications.

As indicated above, we shall create our first server block config file by copying over the default file:

nbsp;sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/

We are then going to open the file using a text editor and make a few changes

nbsp;sudo vim /etc/nginx/sites-available/

Ignoring the commented lines, the configuration should resemble the one below

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/html;
        index index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
                try_files $uri $uri/ =404;

Since we already have the Nginx default server block with the default_server attribute in the server block, we are going to delete the attribute in our domain and have :

server {
     listen 80;
        listen [::]:80;

        . . .

We are then going to adjust the path to our document root and point it to our server's document root

server {
listen 80;
listen [::]:80;

root /var/www/;


Modify the server_name attribute to match our domain

server {
        listen 80;
        listen [::]:80;

        root /var/www/;
        index index.html index.htm index.nginx-debian.html;


        location / {
                try_files $uri $uri/ =404;

Close and exit the configuration file

We are then going to enable the server block by issuing the following command

nbsp;sudo ln -s /etc/nginx/sites-available/

To ensure that there are no syntactical errors in any of our Nginx files, execute

$ sudo nginx -t


check nginx file configurations

Great!! Let's now restart Nginx server

nbsp;sudo systemctl restart nginx

To verify that Nginx is running execute

nbsp;sudo systemctl status nginx


sudo systemctl status nginx

Encrypting Webmin

The final part is securing Webmin to encrypt communication between the browser and the Webmin server.

Click on the 'Webmin' tab

webmin tab

Select 'Web configuration' in the drop-down menu that appears

webmin configuration

Click on SSL 'Encryption'

ssl encryption

Next, Click on the  'Let's  Encrypt' tab. Fill out the hostname in the hostname tab and define the root directory for the validation file as shown. Thereafter click on 'Request Certificate'.

let's encrypt tab settings

Webmin will b generate Let's encrypt SSL certificate  and store the validation file in the website directory defined

webmin requesting new certificate

Go back to the URL and refresh the browser. You will now notice that the connection to the Webmin server is encrypted.

webmin encrypted

You can now log in securely and access the dashboard

webmin dashboard encrypted

To view information about the certificate, click on the padlock symbol and select 'Certificate valid' option

view let's encrypt certififcate

Certificate Information

webmin encrypted


You have come this far, you should be in a position to install Webmin with SSL support using Let's Encrypt certificate. Try it out on your server and let us know your experience.

Related: How to Install Webmin on Ubuntu 20.04

2 Comments... add one

Leave a Comment