1080*80 ad

Installing Webmin on CentOS 8

How to Install Webmin on CentOS 8 (and Rocky/AlmaLinux): A Step-by-Step Guide

Managing a Linux server from the command line is powerful, but it can be time-consuming and complex, especially for intricate tasks. A web-based control panel simplifies this process immensely, and Webmin is one of the most robust and popular options available. It provides a clean graphical interface to manage everything from user accounts and package updates to web server configuration and firewall rules.

This guide provides a comprehensive, step-by-step walkthrough for installing Webmin on CentOS 8.

Important Note on CentOS 8: As of December 31, 2021, CentOS 8 has reached its End-of-Life (EOL) and no longer receives official updates. The instructions in this guide are still valid and will work perfectly on CentOS 8, but for long-term security and stability, we highly recommend migrating to a successor like Rocky Linux or AlmaLinux. The installation process for Webmin on these systems is identical.

What is Webmin?

Webmin is a powerful, open-source web control panel for Unix-like systems. It allows you to administer your server through a modern web browser, eliminating the need to manually edit configuration files.

Key features include:

  • Creating, editing, and deleting user accounts.
  • Configuring DNS, IP addresses, and routing settings.
  • Setting up and managing web servers like Apache or Nginx.
  • Installing, updating, and removing software packages.
  • Configuring a firewall and other security settings.
  • Viewing system logs and reports.

Prerequisites

Before you begin, ensure you have the following:

  • A server running CentOS 8, Rocky Linux, or AlmaLinux.
  • A user account with sudo or root privileges.
  • Your server’s IP address.

Step 1: Update Your System

First, it’s crucial to ensure all your system packages are up to date. This prevents potential conflicts and ensures you have the latest security patches.

Open your terminal and run the following command:

sudo dnf update -y

Step 2: Add the Webmin Repository

To install Webmin, we first need to add its official repository to our system’s package manager. This allows dnf to locate, install, and update Webmin correctly.

Create a new repository file using a text editor like nano:

sudo nano /etc/yum.repos.d/webmin.repo

Paste the following content into the file:

[Webmin]
name=Webmin Distribution Neutral
#baseurl=https://download.webmin.com/download/yum
mirrorlist=https://download.webmin.com/download/yum/mirrorlist
enabled=1

Save the file and exit the editor (in nano, press CTRL+X, then Y, then Enter).

Step 3: Import the Webmin GPG Key

Next, you need to import the GPG (GNU Privacy Guard) key for the repository. This key is used to verify that the packages you are about to install are authentic and have not been tampered with.

Run this command to import the key:

sudo rpm --import http://www.webmin.com/jcameron-key.asc

Step 4: Install Webmin

With the repository and GPG key in place, you can now install Webmin using a single command. The dnf package manager will automatically handle all the necessary dependencies.

sudo dnf install webmin -y

Once the installation is complete, the service will start automatically. You can verify its status to be sure:

sudo systemctl status webmin

If it’s active and running, you’re ready for the final step.

Step 5: Configure the Firewall

By default, Webmin listens on port 10000. To access the web interface from outside your server, you must open this port in your firewall.

Use the following firewall-cmd commands to permanently allow traffic on TCP port 10000 and reload the firewall rules:

sudo firewall-cmd --zone=public --add-port=10000/tcp --permanent
sudo firewall-cmd --reload

You should see a “success” message after each command.

Accessing the Webmin Web Interface

You can now access your new Webmin control panel. Open your favorite web browser and navigate to the following address, replacing your-server-ip with your server’s actual IP address:

https://your-server-ip:10000

Note: You will likely see a browser warning that your connection is not private. This is because Webmin uses a self-signed SSL certificate by default. This is normal and safe to proceed. Click “Advanced” and then “Proceed to…” to continue to the login page.

Log in using your root user and password or another user with sudo privileges.

Essential Security Tips After Installation

Once you have logged in, it’s highly recommended to enhance your Webmin security:

  1. Change the Default Port: The default port 10000 is well-known. You can change it to a non-standard port within the Webmin interface under Webmin > Webmin Configuration > Ports and Addresses. This adds a layer of security through obscurity.
  2. Secure with Let’s Encrypt: Replace the self-signed SSL certificate with a free, trusted certificate from Let’s Encrypt. You can do this easily within Webmin under Webmin > Webmin Configuration > SSL Encryption.
  3. Enable Two-Factor Authentication (2FA): Add a critical layer of security by requiring a second form of verification to log in. This can be configured under Webmin > Webmin Configuration > Two-Factor Authentication.
  4. Keep Webmin Updated: Regularly check for and apply Webmin updates directly from the dashboard to protect against new vulnerabilities.

Congratulations! You have successfully installed and secured the Webmin control panel, giving you a powerful tool to manage your server with ease.

Source: https://kifarunix.com/install-webmin-on-centos-8/

900*80 ad

      1080*80 ad