Installing Webmin on Linux

PowerADM.com / Linux / CentOS / Installing Webmin on Linux

Webmin is an open-source web interface service for managing Linux. You can use Webmin to perform typical Linux administration tasks from a graphical web interface instead of a command-line shell. In this article, we’ll look at how to install and configure Webmin in CentOS and Ubuntu.

Webmin is not included in the standard repositories of most Linux distros, so it must be added manually.

How to Install Webmin in Ubuntu?

In Ubuntu, you need to create a webmin.list file:

vi /etc/apt/sources.list.d/webmin.list

Add the following line:

deb http://download.webmin.com/download/repository sarge contrib

Add a new repository key:

wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc

Update the list of packages:

apt update

To install Webmin in Ubuntu, run the command:

apt install webmin

Enable the service:

systemctl enable webmin –now

By default, webmin listens on port TCP 10000. Open it in the firewall:

iptables -A INPUT -p tcp --dport 10000 -j ACCEPT

Save the firewall rules:

apt install iptables-persistent
netfilter-persistent save

How to Install Webmin on CentOS?

In order to add the Webmin repository to CentOS, create a file:

vi /etc/yum.repos.d/webmin.repo

Add the following repo config:

[Webmin]
name=Webmin Repo
baseurl=https://download.webmin.com/download/yum
enabled=1
gpgcheck=0

Install the package:

yum install webmin

Now you need to add the webmin daemon to startup. You cannot run webmin as a systemd unit and cannot use systemctl to manage the service. If you start the service via systemctl, an error will appear:

Failed to start LSB: web-based administration interface for Unix systems.

Use legacy chkconfig to start the webmin

chkconfig webmin on

Open ports in the firewall:

firewall-cmd --permanent --add-port=10000/{tcp,udp}
firewall-cmd --reload

Check that the service is running and listening on port 10000:

ss -tunlp | grep 10000
service webmin status

Configuring Webmin in Linux

To change the HTTPS certificate for webmin (self-signed cert is used by default), you need to edit the key file:

vi /etc/webmin/miniserv.pem

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----

Add the sequence for the public key (BEGIN CERTIFICATE) and the private key (BEGIN PRIVATE KEY) in the appropriate file sections. You can use the free Let’s Encrypt certificate or any commercial SSL certificate. Restart the service:

service webmin restart

Check the configuration miniserv.conf file:

vi /etc/webmin/miniserv.conf

# allow SSL to connect
ssl=1
certfile=<path_to_certificate>

If ssl=0, or if the path to the certificate is wrong, the error ERR_SSL_PROTOCOL_ERROR appears in the browser when you open webmin.

Now open your browser and go to the connection URL https://your_linux_host:10000/

webmin web interface on linux

Sign in with your root account. The website dashboard will appear in front of you. Now, you can use Webmin to manage your Linux host.

Leave a Reply

Your email address will not be published. Required fields are marked *