Install Webmin on Ubuntu 24.04

By Anurag Singh

Updated on Oct 01, 2024

Install Webmin on Ubuntu 24.04

In this tutorial, we shall explain how install Webmin on Ubuntu 24.04 server. 

Webmin is a powerful web-based control panel that allows you to manage various aspects of your server, such as user accounts, DNS, firewall, databases, and more through a simple web interface. This guide will walk you through installing Webmin on AlmaLinux 9, configuring it for secure access, and managing your server via the Webmin interface.

Prerequisites

  • A server running Ubuntu 24.04 dedicated server or KVM VPS.
  • A root or non-root user with sudo privileges.
  • A domain name pointing to your server’s IP address.
  • Basic knowledge of the command line and Linux administration.

Install Webmin on Ubuntu 24.04

Step 1: Update System Packages

Before installing Webmin, ensure your system’s package list is updated by running the following command:

sudo apt update && sudo apt upgrade -y

Step 2: Install Webmin

The simplest and best way to get Webmin is to use automatic setup-repos.sh script to configure repositories on your RHEL derivative systems. It can be done in two easy steps:

curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
sh setup-repos.sh

After adding the Webmin repository, update the package list again and install Webmin:

apt-get install --install-recommends webmin

Webmin will now be installed and the service should automatically start.

To verify that Webmin is installed and running, check the status of the Webmin service:

sudo systemctl status webmin

You should see output indicating that the Webmin service is active (running).

Step 3: Configure Firewall to Allow Webmin Access

By default, Webmin listens on port 10000 but we are using Nginx as a reverse proxy server, we're using HTTP and HTTPS ports. If you’re using UFW (Uncomplicated Firewall), enable access with the following command:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reload

Check the firewall status to ensure the rule is added:

sudo ufw status

Step 4: Install and Configure Nginx

If Nginx is not already installed on your Ubuntu 24.04 system, install it using the following command:

sudo apt install nginx -y

Once installed, ensure Nginx is running:

sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx

Now let's configure Nginx as a Reverse Proxy for Webmin

Create a new Nginx server block to proxy Webmin traffic through Nginx. You can do this by creating a configuration file under /etc/nginx/sites-available/.

For example, create a file called webmin.conf:

sudo nano /etc/nginx/sites-available/webmin.conf

Add the following configuration to the file:

server {
    listen 80;
    server_name <your_domain>;

    location / {
        proxy_pass https://localhost:10000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Replace <your_domain> with your actual domain name.

Enable the Nginx configuration by creating a symlink from sites-available to sites-enabled:

sudo ln -s /etc/nginx/sites-available/webmin.conf /etc/nginx/sites-enabled/

Test the Nginx configuration to ensure there are no syntax errors:

sudo nginx -t

Restart Nginx to apply the changes:

sudo systemctl restart nginx

At this point, Nginx is set up as a reverse proxy, and Webmin can be accessed using your domain on port 80, but the connection is not yet secured with SSL.

Step 5: Install Let's Encrypt SSL Certificate with Certbot

Install Certbot and the Nginx plugin:

sudo apt install certbot python3-certbot-nginx -y

Obtain an SSL certificate for your domain using Certbot:

sudo certbot --nginx -d <your_domain>

Replace <your_domain> with your actual domain name. Follow the prompts to complete the SSL certificate installation. Certbot will automatically configure Nginx to use the SSL certificate.

Step 6: Access Webmin Interface

Now that Webmin is installed and allowed through the firewall, you can access its web interface.

Open a web browser and enter the following URL:

https://<your_domain>

You will see a warning that the connection is not secure because Webmin uses a self-signed SSL certificate by default. You can safely ignore this warning by clicking Advanced and then proceeding to the website.

Log in using your system's root username and password or a user with sudo privileges.

Step 7: Managing Server Tasks with Webmin Interface

Once logged into the Webmin interface, you can manage various server tasks through an easy-to-use dashboard. Some tasks include:

  • User and Group Management: Create, modify, or delete users and groups.
  • Package Management: Install, update, or remove software packages.
  • File Management: Browse and manage files on the server.
  • Service Management: Start, stop, or restart services like Apache, Nginx, MySQL, etc.
  • Server Monitoring: View system performance, disk usage, and server logs.

Conclusion

In this tutorial, you learned how to install Webmin on Ubuntu 24.04 server, configure it for secure access, and manage server tasks through the Webmin interface. By following these steps, you now have a powerful web-based control panel to simplify server management.

For more advanced configurations, explore the Webmin documentation and modules to extend its functionality according to your needs.