How to Install Webmin on Debian 12

Updated on November 21, 2023
How to Install Webmin on Debian 12 header image

Introduction

Webmin is a web-based application for managing Unix-like systems. You can use the Webmin graphical user interface (GUI) to add users, allocate disk quotas, manage apps, configure networks, and run database systems. Webmin is highly extensible and supports many open-source tools that enable multiple functionalities on a server.

This article explains how to install Webmin on Debian 12 and enable access to the web-based graphical interface.

Prerequisites

Before you begin:

Install Webmin

Webmin is not available in the default package repositories on Debian 12. Follow the steps below to download the latest Webmin repository information script and install the application.

  1. Download the latest Webmin repository setup script and save it as setup-repos.sh.

    console
    $ curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
    
  2. Run the script using the Bash interpreter.

    console
    $ sudo bash setup-repos.sh
    

    Enter Y and press Enter when prompted to proceed with the repository installation. When successful, your output should be similar to the one below.

    Setup repository? (y/N) y
        Downloading Webmin key ..
        .. done
        Installing Webmin key ..
        .. done
        Setting up Webmin repository ..
        .. done
        Cleaning repository metadata ..
        .. done
        Downloading repository metadata ..
        .. done
    Webmin package can now be installed using apt-get install --install-recommends webmin command.
  3. Update your system's package information index to apply the Webmin repository information.

    console
    $ sudo apt update
    
  4. Install Webmin and the default recommended packages.

    console
    $ sudo apt install webmin --install-recommends -y
    
  5. Enable the Webmin service to automatically start at system boot.

    console
    $ sudo systemctl enable webmin
    
  6. Start the Webmin service.

    console
    $ sudo systemctl start webmin
    
  7. View the Webmin system service status and verify it's running.

    console
    $ sudo systemctl status webmin
    

    Output:

    ● webmin.service - Webmin server daemon
         Loaded: loaded (/lib/systemd/system/webmin.service; enabled; preset: enabled)
         Active: active (running) since Mon 2024-08-19 14:15:47 EDT; 42s ago
       Main PID: 4614 (miniserv.pl)
          Tasks: 1 (limit: 4572)
         Memory: 125.7M
            CPU: 2.060s
         CGroup: /system.slice/webmin.service
                └─25004614 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf

    Webmin is active and running based on the above output information.

Secure Webmin

Webmin runs on the default TCP port 10000 and serves the web administration control panel using HTTP. Generate trusted SSL certficates to secure network connections to the Webmin interface using HTTPS. Follow the steps below to install the Certbot Let's Encrypt client and enable Webmin to use trusted SSL certificate files.

  1. Allow HTTP traffic on the default port 80 to enable Let's Encrypt validations.

    console
    $ sudo ufw allow 80/tcp
    
  2. Restart UFW to apply the new changes.

    console
    $ sudo ufw reload
    
  3. Install the Certbot Let's Encrypt client tool.

    console
    $ sudo apt install certbot -y
    
  4. Generate a new SSL certificate for your domain. Replace webmin.example.com with your domain and webmin@example.com with your actual email address.

    console
    $ sudo certbot certonly --standalone -d webmin.example.com -m webmin@example.com --agree-tos
    

    Your output should be similar to the one below when successful.

    ...
    Successfully received certificate.
    Certificate is saved at: /etc/letsencrypt/live/webmin.example.com/fullchain.pem
    Key is saved at:         /etc/letsencrypt/live/webmin.example.com/privkey.pem
    ...

    Certbot stores the SSL certificate and private key files in the /etc/letsencrypt/live/webmin.example.com/ directory based on the above output.

  5. Combine the SSL certificate and private key contents into a single file such as webmin_key_cert.pem.

    console
    $ sudo cat /etc/letsencrypt/live/webmin.example.com/fullchain.pem /etc/letsencrypt/live/webmin.example.com/privkey.pem > webmin_key_cert.pem
    
  6. Move the file to the /etc/webmin/ Webmin data directory.

    console
    $ sudo mv webmin_key_cert.pem /etc/webmin/
    
  7. Open the /etc/webmin/miniserv.conf Webmin configuration file using a text editor like nano.

    console
    $ sudo nano /etc/webmin/miniserv.conf
    
  8. Find the keyfile directive and replace the value with your webmin_key_cert.pem SSL certificate path.

    ini
    keyfile=/etc/webmin/webmin_key_cert.pem
    
  9. Restart the Webmin service to apply the configuration changes.

    console
    $ sudo systemctl restart webmin
    

Set Up Firewall Rules

Uncomplicated Firewall (UFW) is available and active on Vultr Debian instances by default. Follow the steps below to set up new firewall rules and allow network connections to the Webmin interface.

  1. View the UFW status and verify that it's active.

    console
    $ sudo ufw status
    
  2. Allow network connections to the default Webmin port 10000.

    console
    $ sudo ufw allow 10000/tcp
    
  3. Allow incoming HTTPS connections.

    console
    $ sudo ufw allow https
    
  4. Deny incoming HTTP connections to disable insecure requests.

    console
    $ sudo ufw deny http
    
  5. Reload UFW to apply the firewall changes.

    console
    $ sudo ufw reload
    
  6. View the UFW status and verify the new connection rules are available.

    console
    $ sudo ufw status
    

    Output:

    
    Status: active
    
    To                         Action      From
    --                         ------      ----
    443                        ALLOW       Anywhere
    80                         ALLOW       Anywhere
    80/tcp                     DENY        Anywhere
    OpenSSH                    ALLOW       Anywhere
    10000/tcp                  ALLOW       Anywhere
    443 (v6)                   ALLOW       Anywhere (v6)
    80 (v6)                    ALLOW       Anywhere (v6)
    80/tcp (v6)                DENY        Anywhere (v6)
    OpenSSH (v6)               ALLOW       Anywhere (v6)
    10000/tcp (v6)             ALLOW       Anywhere (v6)

Access Webmin

Webmin listens for incoming connection requests on the default port 10000 based on the /etc/webmin/miniserve.conf configuration. Follow the steps below to access the Webmin web administration interface on port 10000.

  1. Access your domain on port 10000 using a web browser such as Chrome.

    https://webmin.example.com:10000
  2. Enter your non-root sudo user credentials when prompted to log in to the Webmin interface.

    Image of the Webmin login interface

  3. Click Dashboard on the main navigation menu to access the system information summary.

    Image showing the server's dashboard on Webmin

Conclusion

You have installed Webmin on a Debian 12 and secured the control panel interface with trusted Let's Encrypt SSL certificates. Webmin lets you use a GUI to manage and monitor your system applications and services. For more information, please visit the Webmin documentation.