Best Steps To Set up Webmin on Rocky Linux 8 – OrcaCore

Posted on

Best Steps To Set up Webmin on Rocky Linux 8 – OrcaCore

In this guide, we want to teach you to Set up Webmin on Rocky Linux 8. Webmin is a web-based interface for system administration for Linux/Unix. It also allows for controlling many machines through a single interface, or seamless login on other Webmin hosts on the same subnet or LAN.

You would use any modern web browser to connect to your server. It removes the need to edit Linux/Unix configuration files manually, and it lets you manage a server from the console or remotely. You can configure operating system internals such as users, service or configuration files, and disk quotas and modify and control open source applications such as Apache or Tomcat, PHP, MySQL, DNS, and file sharing. It is based on Perl and runs as its process and the web server.

Now follow the guide steps below on the Orcacore website to Set up Webmin on Rocky Linux 8.

Prerequisites

To complete this guide, you must log in to your server as a root user and set up a basic firewall. To do this, you can follow our guide the Initial Server Setup with Rocky Linux 8.

Install Webmin on Rocky Linux 8

At this point, you need to add the Webmin repository to your server to fetch the Webmin packages for installation using a single command.

To do this, run the following command:

cat << EOF > /etc/yum.repos.d/webmin.repo
[Webmin]
name=Webmin
mirrorlist=https://download.webmin.com/download/yum/mirrorlist
enabled=1
gpgkey=http://www.webmin.com/jcameron-key.asc
EOF

Then, update your local package index with the following command:

dnf update -y

Now use the following command to install Webmin on your server:

dnf install webmin -y

Check that your Webmin service is active and running on your Rocky Linux 8:

systemctl status webmin

In your output you will see:

**Output**
● webmin.service - Webmin server daemon
   Loaded: loaded (/usr/lib/systemd/system/webmin.service; enabled; vendor pres>
   Active: **active** (**running**) since Mon 2023-03-20 13:32:44 EDT; 2s ago
  Process: 91048 ExecStart=/usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv>
 Main PID: 91049 (miniserv.pl)
    Tasks: 4 (limit: 23699)
   Memory: 97.3M
   CGroup: /system.slice/webmin.service
           └─91049 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/mi>
           └─91050 /usr/libexec/webmin/webmincron/webmincron.pl
           └─91474 sh -c /bin/dnf check-update 2>/dev/null 2>/dev/null
           └─91478 /usr/libexec/platform-python /bin/dnf check-update
...

Configure Firewall for Webmin on Rocky Linux 8

By default, Webmin listens on port 10000. You can check it using the following command:

ss -antpl | grep 10000

You should see the following output:

**Output**
LISTEN 0 128 0.0.0.0:10000 0.0.0.0:* users:(("miniserv.pl",pid=39568,fd=6))

Now you need to allow Webmin port 10000 through the Rocky Linux firewall with the following command:

firewall-cmd --add-port=10000/tcp --permanent

To apply the new rules, reload the firewall:

firewall-cmd --reload

Access Webmin Dashboard

At this step, you can access your Webmin dashboard on Rocky Linux 8 through the web interface by typing your server’s IP address in your web browser followed by 10000:

https://<mark>server-ip</mark>:10000

You will see your Webmin Default login screen:

Webmin login screen
Webmin Default login Screen

Provide your root username, and password, and click on the Sign in button. You should see the Webmin dashboard:

Webmin Dashboard

From here, you can configure operating system internals such as users, service or configuration files, and disk quotas, as well as modify and control open-source applications such as Apache or Tomcat, PHP, MySQL, DNS, and file sharing.

How To Use Webmin

From your dashboard, in the left pane, click on Tools => Command Shell. You can access your Linux terminal and execute your commands.

Command Shell

You can easily create a file or directory and manage the entire file system. To do this, Click on Tools => File Manager.

Webmin File Manager

To upload and download any file to your Rocky Linux 8 server, Click on Tools => Upload and Download from your Webmin dashboard.

Upload and Download

Click on the Networking => Network Configuration. You should see the network configuration wizard.

From here, you can set up a static IP address, default gateway, hostname, and DNS.

Network Configuration

Click on the Hardware => Partitions and Local Disks.

From here, you can create and edit your hard disk partitions.

Conclusion

At this point, you have learned to Set up Webmin on Rocky Linux 8. Webmin allows you to control many machines through a single interface. This makes system administration much more efficient. This article provided the best steps to Set up Webmin on Rocky Linux 8.

Hope you enjoy it. Please subscribe to us on Facebook, Twitter, and YouTube.

You may also interested in these articles:

How To Install Vagrant on Rocky Linux 8

Install OpenJDK 19 on Rocky Linux 8

Install Apache Kafka on Rocky Linux 8

Installing Elasticsearch Rocky Linux 8

Learn to Use htop command on Rocky Linux 8

Postfix Mail Server Setup Rocky Linux 8

Fiber Server Setup with Golang on Rocky Linux 8

Google Chrome Setup Rocky Linux 8

GlassFish Setup on Rocky Linux 8

Enable Brotli Compression Rocky Linux 8

Alternative Solutions for Webmin Installation on Rocky Linux 8

While the provided method for installing Webmin on Rocky Linux 8 is perfectly valid and straightforward, let’s explore two alternative approaches to achieve the same goal. These methods offer different advantages and cater to diverse preferences and requirements.

1. Using Cockpit Web Console

Cockpit is a web-based interface that’s already integrated into Rocky Linux 8 and provides similar functionality to Webmin, though with a different design philosophy. Unlike Webmin, which is a third-party application, Cockpit is developed and maintained by Red Hat, ensuring seamless integration with the operating system. It uses the system’s existing accounts for authentication and interacts with the system using standard systemd utilities, making it a more "native" experience.

Explanation:

Cockpit offers a clean and modern interface for managing your Rocky Linux 8 server. It allows you to monitor system performance, manage storage, configure networking, administer user accounts, and even manage virtual machines (if you have virtualization enabled). The key advantage of using Cockpit is that it leverages existing system tools and configurations. This means you’re not introducing a separate management layer; instead, you’re utilizing the tools that are already part of the operating system. This approach often results in a more stable and secure management experience.

Installation and Access:

Cockpit is usually pre-installed on Rocky Linux 8. If it’s not, you can install it using the following command:

dnf install cockpit -y

Enable and start the Cockpit service:

systemctl enable --now cockpit.socket

Configure the firewall to allow access to Cockpit on port 9090:

firewall-cmd --add-service=cockpit --permanent
firewall-cmd --reload

Now, access Cockpit by navigating to https://<server-ip>:9090 in your web browser. Log in using your regular system username and password.

Why Choose Cockpit?

  • Integration: Tightly integrated with Rocky Linux 8.
  • Security: Uses existing system accounts and tools.
  • Modern Interface: Clean and intuitive user interface.
  • Resource Efficiency: Generally lighter on system resources compared to Webmin.

2. Containerization with Docker

Another alternative is to run Webmin within a Docker container. This approach offers several benefits, including isolation, portability, and simplified updates. Docker containers encapsulate Webmin and its dependencies, preventing conflicts with other software on your system.

Explanation:

Running Webmin in a Docker container means you’re creating a self-contained environment for the application. This environment includes all the necessary libraries, dependencies, and configurations required for Webmin to function correctly. The main advantage of containerization is isolation. If something goes wrong within the container, it won’t affect the host system. Furthermore, Docker containers are portable, meaning you can easily move them between different environments (e.g., from your development machine to your production server) without worrying about compatibility issues.

Installation and Configuration:

  1. Install Docker: If you don’t already have Docker installed, you can install it using the following commands:

    dnf install docker -y
    systemctl enable --now docker
  2. Pull the Webmin Docker Image: Find a suitable Webmin Docker image on Docker Hub. For example, you can use the webmin/webmin image.

    docker pull webmin/webmin
  3. Run the Webmin Container:

    docker run -d -p 10000:10000 --name webmin --restart=always -v webmin_data:/var/webmin webmin/webmin

    Explanation of the command:

    • -d: Runs the container in detached mode (in the background).
    • -p 10000:10000: Maps port 10000 on the host to port 10000 in the container.
    • --name webmin: Assigns the name "webmin" to the container.
    • --restart=always: Ensures that the container automatically restarts if it crashes.
    • -v webmin_data:/var/webmin: Creates a named volume webmin_data to persist Webmin data. This is crucial for preventing data loss when the container is stopped or restarted.
  4. Access Webmin: Access Webmin through your web browser at https://<server-ip>:10000.

Why Choose Docker?

  • Isolation: Webmin runs in a self-contained environment, preventing conflicts.
  • Portability: Easily move Webmin between different environments.
  • Simplified Updates: Updating Webmin is as easy as pulling a new Docker image.
  • Data Persistence: Using volumes ensures that your Webmin data is preserved.

In conclusion, while the initial method to Set up Webmin on Rocky Linux 8 is effective, Cockpit offers a more integrated approach, and Docker provides isolation and portability. The best choice depends on your specific needs and preferences.