How to Install Centos GUI (Webmin) on CentOS 8 (Step by Step)

How to Install Centos GUI (Webmin) on CentOS 8. In this post, we will introduce Webmin, its features and major advantages. Then, we will explain how to install Webmin with Nginx as a reverse proxy and SSL support.

 

Shall we start with How to Install Centos GUI (Webmin) on CentOS 8.

What Is Webmin?

First of all Webmin is a web based interface for Linux/Unix system administrations. With the help of Webmin, you can control several machines through a single interface or login seamlessly to other Webmin hosts. Also, you do not have to manually edit Linux/Unix configuration files. Instead, you can manage a server from the console or remotely.

Moreover, Webmin helps you configure operating system internals such as users, disk quotas and service or configuration files. In addition it modifies and controls open source applications like Apache or Tomcat, MySQL, file sharing, PHP and DNS. Based on Perl, it runs as its own process and the web server.

Features of Webmin

The features provided by Webmin are:

  • After installing the command shell, you can configure PHP versions and variables from the dashboard.
  • Automatically supports the Email server built on Exim, Postfix, Dovecot, or Gmail.
  • Gives a SpamAssassin package for spam filtering.
  • Offers Native Server security features, which include IPTables firewalls, RAID configurations, two factor authentication, directory protection, log viewers and many more during the involvement of third party.
  • With Virtualmin it serves as reseller hosting business.
  • It’s Graphical File Management makes editing, downloading and uploading files relatively seamless.
  • The Usermin enables you to create restricted Webmin accounts for website owners to manage raw files within their root directory.
  • Possibility to restrict access by changing the file permission.

Advantages Of Webmin

Since we use Webmin for commercial and non commercial use, it can be freely distributed and modified against a BSD like license. Above all it supports modules that anyone can develop and distribute for any purpose and under any permit.

The advantages provided by Webmin are:

Related Software

You can expand Webmin by installing modules. All in all Webmin’s developer community can develop it. Moreover, it bolsters functionality through two critical projects:

  • First is Webmin features. Those include webmail or other user related tasks. Usermin controls and presents them.
  • Second with Virtualmin, a web hosting managing interface. Basically it is pre installed on Webmin so that you can host websites and domains. This way, you can manage their website with ease.

Accessibility

Another key point with Webmin is that it enables you to connect to your server by using a web browser. You must typically configure your server to use SSL to log in securely. Further, you can make the process more secure by changing the TCP port to another one.

If you are new at accessing the server, you might get an error message because the certificate for HTTPS is self signed. Next, you will be taken to a login page when you have accepted this certificate.

Common Modules

From Webmin’s interface to configuration files and the development of the Webmin server is through the modules. Thanks to that, it makes it simple to add more features. Basically Webmin’s modular design helps anyone in writing desktop configuration plugins. Using a module, you can manage Linux/Unix in multiple ways:

  • Selecting Webmin users from the menu to add or remove users.
  • Choosing Other and then Command Shell help you commence the command line.
  • Add websites to the Apache web servers by going to servers Apache web server after installation.
  • Selecting Webmin and then Webmin Configurations to customize Webmin.
  • Accessing file manager by clicking on the Other Option and then the File Manager.
  • During system startups and shutdowns, you can completely control daemons starts and stops. What is more, you can also access the entire run levels and start and stop custom applications.
  • Besides Webmin’s system menu items enable you to access System and Software packages. Also it allows you to look up information concerning specific software packages, install or remove it, or even update it by looking up this page.

Next with How to Install Centos GUI (Webmin) on CentOS 8 is the main part of our article.

How to Install Centos GUI (Webmin) on CentOS 8

Prerequisites

  • A user with root or sudo privileges.

Download and Install Webmin

By default, Webmin package is not available in the CentOS 8 default repo. So you will need to download it from its official website. First, install the Perl command line utility with the following command:

				
					dnf install perl -y
				
			

After that, download the latest version of Webmin using the wget utility:

				
					wget https://www.webmin.com/download/webmin-current.tar.gz
				
			

So, after the successful download, create Webmin installation directory using the following command:

				
					mkdir -p /usr/local/webmin
				
			

Then is to run the Webmin installation script to start the Webmin installation:

				
					./webmin-2.000/setup.sh /usr/local/webmin/
				
			

During the installation, you will be asked to provide the Webmin configuration directory, log directory, port, admin username and password as shown below:

				
					***********************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.

Installing Webmin from /root/webmin-2.000 to /usr/local/webmin/

***********************************************************************
Webmin uses separate directories for configuration files and log files.
Unless you want to run multiple versions of Webmin at the same time
you can just accept the defaults.

Config file directory [/etc/webmin]: 
Log file directory [/var/webmin]: 

***********************************************************************
Webmin is written entirely in Perl. Please enter the full path to the
Perl 5 interpreter on your system.

Full path to perl (default /usr/bin/perl): 

Testing Perl ..
.. done

***********************************************************************
Operating system name:    Rocky Linux
Operating system version: 8.5

***********************************************************************
Webmin uses its own password protected web server to provide access
to the administration programs. The setup script needs to know :
 - What port to run the web server on. There must not be another
   web server already using this port.
 - The login name required to access the web server.
 - The password required to access the web server.
 - If the web server should use SSL (if your system supports it).
 - Whether to start webmin at boot time.

Web server port (default 10000): 

Login name (default admin): 
Login password: 
Password again: 
Use SSL (y/n): n
Start Webmin at boot time (y/n): y

***********************************************************************

***********************************************************************
Webmin has been installed and started successfuly. Use your web
browser to go to

  http://centos8:10000/

and login with the name and password you entered previously.

				
			

Once the Webmin is installed, you can verify the status of the Webmin service using the following command:

				
					systemctl status webmin
				
			

If everything is fine, you will get the following output:

				
					● webmin.service - Webmin server daemon
   Loaded: loaded (/usr/lib/systemd/system/webmin.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2022-09-14 04:24:44 UTC; 5min ago
  Process: 6743 ExecStart=/usr/local/webmin//miniserv.pl /etc/webmin/miniserv.conf (code=exited, status=0/SUCCESS)
 Main PID: 6744 (miniserv.pl)
    Tasks: 2 (limit: 11412)
   Memory: 106.4M
   CGroup: /system.slice/webmin.service
           ├─6744 /usr/bin/perl /usr/local/webmin/miniserv.pl /etc/webmin/miniserv.conf
           └─8008 /usr/bin/perl /usr/local/webmin/miniserv.pl /etc/webmin/miniserv.conf

Sep 14 04:24:43 centos8 systemd[1]: Starting Webmin server daemon...
Sep 14 04:24:43 centos8 webmin[6743]: Webmin starting
Sep 14 04:24:44 centos8 systemd[1]: webmin.service: Can't open PID file /var/webmin/miniserv.pid (yet?) after start: No such file or directory
Sep 14 04:24:44 centos8 systemd[1]: Started Webmin server daemon.

				
			

Configure Firewall for Webmin

At this point, Webmin is start and listens on port 10000. You can check it with the following command:

				
					ss -antpl | grep 10000
				
			

You should see the Webmin port in the following output:

				
					LISTEN 0      128          0.0.0.0:10000      0.0.0.0:*    users:(("miniserv.pl",pid=6744,fd=7))
				
			

Following that step you will need to allow port 10000, 80 and 443 through the firewalld. You can allow all ports with the following command:

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

Next, reload the firewalld service to apply all rules:

				
					firewall-cmd --reload
				
			

Access Webmin Dashboard

1. Now, open your web browser and access the Webmin dashboard using the URL http://your-server-ip:10000. You should see the Webmin login page:

2. Provide your admin username, password and click on the Login button. You should see the Webmin dashboard on the following screen:

3. Click on the System => Running Processes. You should see all system processes on the following screen:

4. Click on the Tools => Command Shell. You should see the Webmin command shell. Using this shell, you can run any command on the Webmin server.

5. Click on the Tools => File Manager. You should see your system directory structure on the following screen:

Up next with How to Install Centos GUI (Webmin) on CentOS 8 is to configure Nginx.

Configure Nginx as a Reverse Proxy for Webmin

It is a good idea to configure Nginx as a reverse proxy for Webmin. Then, you can access the Webmin via Nginx port. First of all, install the Nginx web server using the following command:

				
					dnf install nginx -y
				
			

After the installation, create an Nginx configuration file for Webmin:

				
					nano /etc/nginx/conf.d/webmin.conf
				
			

Add the following configurations:

				
					server {
       listen 80;
       server_name webmin.example.com;

       access_log /var/log/nginx/webmin.access;
       error_log /var/log/nginx/webmin.error;

       location / {
              proxy_pass http://127.0.0.1:10000;
              #proxy_set_header Host $http_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;
        }
}

				
			

Save the file then restart the Nginx service to apply the changes:

				
					systemctl restart nginx
				
			

You can check the status of the Nginx with the following command:

				
					systemctl status nginx
				
			

You will get the following output:

				
					● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2022-09-14 04:31:57 UTC; 5s ago
  Process: 8401 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 8400 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 8398 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 8403 (nginx)
    Tasks: 2 (limit: 11412)
   Memory: 6.7M
   CGroup: /system.slice/nginx.service
           ├─8403 nginx: master process /usr/sbin/nginx
           └─8404 nginx: worker process

Sep 14 04:31:56 centos8 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Sep 14 04:31:57 centos8 nginx[8400]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Sep 14 04:31:57 centos8 nginx[8400]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Sep 14 04:31:57 centos8 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Sep 14 04:31:57 centos8 systemd[1]: Started The nginx HTTP and reverse proxy server.

				
			

Secure Webmin with Let's Encrypt SSL

As I have also noted, it is a good idea to secure the Webmin via Let’s Encrypt SSL. Firstly, install the Certbot client package to manage the SSL certificates.

				
					dnf install epel-release -y
dnf install python3-certbot-nginx -y
				
			

Consequently, run the following command to download and install the Let’s Encrypt SSL on Webmin:

				
					certbot --nginx -d webmin.example.com
				
			

Provide your valid email address accept the term of service to start the installation. After the successful installation, you will get the following output:

				
					Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): hitjethva@gmail.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfuly issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Account registered.
Requesting a certificate for webmin.example.com

successfuly 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 2022-12-13.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
successfuly deployed certificate for webmin.example.com to /etc/nginx/conf.d/webmin.conf
Congratulations! You have successfuly enabled HTTPS on https://webmin.example.com
We were unable to subscribe you the EFF mailing list because your e-mail address appears to be invalid. You can try again later by visiting https://act.eff.org.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

				
			

Here, at this point, you will need to edit the Webmin configuration file and define your domain name:

				
					nano /etc/webmin/config
				
			

Add / modify the following line:

				
					referers=webmin.example.com
				
			

Save and close the file then edit another file and enable the SSL support:

				
					nano /etc/webmin/miniserv.conf
				
			

Change the following lines:

				
					ssl=1
allow=127.0.0.1
				
			

Save and close the file then restart the Webmin service to apply the configuration changes:

				
					systemctl restart webmin
				
			

Thank you for reading How to Install Centos GUI (Webmin) on CentOS 8. Let’s conclude. 

How to Install Centos GUI (Webmin) on CentOS 8 Conclusion

In this post, we showed you how to install Webmin with Nginx as a reverse proxy with SSL support on CentOS 8. Finally, Webmin is a very useful tool for beginner users to control the Linux server via web browser. For more information, check out the Webmin official documentation.

If you would like to know more of our Webmin content take a look at more of our articles here

Avatar for Hitesh Jethva
Hitesh Jethva

I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x