How to Install Webmin on Ubuntu 24.04

Updated on July 25, 2024
How to Install Webmin on Ubuntu 24.04 header image

Introduction

Webmin is an open-source server management control panel that lets you perform system administration tasks using a web-based graphical user interface (GUI) on Linux systems. It offers a modular design with a core set of functionalities with the ability to install additional modules and manage various system aspects such as user accounts, disk quotas, networking, and applications.

This article explains how to install Webmin on Ubuntu 24.04 server to manage and monitor system functionalities using the web-based control panel.

Prerequisites

Before you begin:

Install Webmin

Webmin is not available in the default Ubuntu 24.04 APT repositories. Follow the steps below to download the latest Webmin repository information and install the application on your server.

  1. Download the latest Webmin repository script.

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

    console
    $ sudo bash setup-repos.sh
    
  3. Install Webmin with all recommended packages.

    console
    $ sudo apt install --install-recommends webmin -y
    
  4. View the Webmin system service and verify that it's running.

    console
    $ sudo systemctl status webmin
    

    Output:

    ● webmin.service - Webmin server daemon
         Loaded: loaded (/usr/lib/systemd/system/webmin.service; enabled; preset: enabled)
         Active: active (running) since Thu 2024-06-06 04:53:54 UTC; 43s ago
        Process: 5537 ExecStart=/usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf (code=exited, status=0/SUCCESS)
       Main PID: 5538 (miniserv.pl)
          Tasks: 1 (limit: 2269)
         Memory: 136.3M (peak: 219.0M)
            CPU: 7.408s
         CGroup: /system.slice/webmin.service
                 └─5538 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf

Secure Webmin

The Webmin control panel is accessible on the default server port 10000 using HTTP which creates unencrypted connections between your server and a web browser. Secure Webmin by changing your default server port if necessary and encrypt all network connections using HTTPS with trusted SSL certificates. Follow the steps below to generate trusted Let's Encrypt SSL certificates and encrypt all network connections to the Webmin interface.

  1. Allow the HTTP connections through the default firewall to enable Let's Encrypt validations.

    console
    $ sudo ufw allow 80/tcp
    
  2. Install the Certbot Let’s Encrypt client application.

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

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

    When the certificate request is successful, your output should look like the one below:

    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    ..................
    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
    This certificate expires on 2024-09-04.
    These files will be updated when the certificate renews.
    Certbot has set up a scheduled task to automatically renew this certificate in the background.

    Based on the above output, Certbot saved the SSL certificate and private key files to the /etc/letsencrypt/live/webmin.example.com/ directory.

  4. Run the following command to merge the SSL certificate and private key into a single .pem file. For example, webmin.pem.

    console
    $ sudo cat /etc/letsencrypt/live/webmin.example.com/fullchain.pem /etc/letsencrypt/live/webmin.example.com/privkey.pem > webmin.pem
    
  5. Move the new certificate file to the Webmin configurations directory.

    console
    $ sudo mv webmin.pem /etc/webmin/
    
  6. Open the main Webmin configuration file using a text editor such as Nano.

    console
    $ sudo nano /etc/webmin/miniserv.conf
    
  7. Find and replace the keyfile value with your SSL certificate file location.

    ini
    keyfile=/etc/webmin/webmin.pem
    
  8. Restart Webmin to apply the new SSL configuration changes.

    console
    $ sudo systemctl restart webmin
    

Set Up Firewall Rules

Uncomplicated Firewall (UFW) is active on Ubuntu 24.04 servers by default. Follow the steps below to configure the firewall to allow network connections to the default Webmin interface port 10000 and enable HTTPS network connections on the server.

  1. Allow the Webmin port 10000.

    console
    sudo ufw allow 10000
    
  2. Allow the HTTPS network connections.

    console
    $ sudo ufw allow https
    
  3. Deny insecure HTTP connections on the server.

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

    console
    $ sudo ufw reload
    
  5. View the UFW status to verify all available connection rules.

    console
    $ sudo ufw status
    

    Your output should look like the one below.

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

Access Webmin

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

    https://webmin.example.com:10000
  2. Enter your sudo user account details and click Sign In to log in and access the Webmin control panel.

    Webmin login page

    All system users with login privileges on your server can access and use the Webmin control panel. However, only privileged users (sudo) can perform administrative tasks using the interface.

  3. Verify your server system information within the Webmin dashboard including your CPU usage, memory usage, disk space, running processes and statistics.

    Webmin dashboard page

  4. Expand System on the main navigation menu and click Software Package Updates to view packages that require updates on your server.

  5. Select and verify the list of packages that require updates on your server. Then, click Update Selected Packages to view all installable packages.

    Update Server Application Packages using Webmin

  6. Click Install Now to update the selected packages on your server.

  7. Click Tools and select File Manager to manage files on your server.

    Access file manager

  8. Navigate to Tools and select Terminal to open a new terminal shell on your server.

    Access terminal

Conclusion

You have installed Webmin on Ubuntu 24.04 server and secured the control panel with trusted SSL certificates. In addition, accessed the Webmin control panel and performed basic server administration tasks. The control panel lets you keep your server packages up to date, manage the filesystem and other system components such as users, processes, among other features. For more information and configuration options, please visit the Webmin documentation.