Webmin is a web-based remote management application for system administration that simplifies the process of managing Unix like systems. It is much easier and simpler than the traditional method in which you have to manually modify the configuration files, execute commands for user accounts creation, setting up servers, and much more. It let you handle these tasks with a single, standardized web-interface by automatically updating the required configuration files. With it, you can manage user accounts, setting up disk quotas, installing, removing applications, changing network-related settings, managing database, sharing files, etc.
In this article, we will guide you step-by-step to install Webmin on Debian 10 OS. We will also discuss how to configure and access Webmin with a domain name and how to secure it by using a free Let’s Encrypt SSL certificate.
Webmin Installation on Debian 10
Webmin is installed through a command-line terminal. In order to open the terminal, go to the Activities tab on the top left corner of the desktop. Then in the search bar, type terminal. when the terminal icon appears, click on it to open.
Adding Webmin Repository
There are two methods through which we can add the Webmin repository in our sources list. We will describe here both methods.
Webmin packages are not available in the official Debian repositories. It is available for download in RPM, DEB and TAR packages. So first, we will need to add the Webmin repository link to the sources.list file. For this, open the /etc/apt/sourceslist file using the following command:
$ sudo nano /etc/apt/sources.list
then at the bottom of the file, enter the following line to add the Webmin repository :
deb http://download.webmin.com/download/repository sarge contrib
Once done, press Ctrl+O to save and then Ctrl+X to exit.
Next in this step, we will have to fetch the Webmin PGP key with which the repository was signed. Execute the following command to do so:
$ wget http://www.webmin.com/jcameron-key.asc
Now add the key using the following command:
There is an alternative way of adding the repository and key. Follow the below steps to do so:
To download and add the Webmin repository key, execute the following command in Terminal:
$ wget -qO- http://www.webmin.com/jcameron-key.asc | sudo apt-key add
Then to add the Webmin repository, execute the following command in Terminal:
$ sudo add-apt-repository "deb http://download.webmin.com/download/repository sarge contrib"
Now we will update the Debian list of packages with the Webmin repository. For that, run the following command in terminal:
$ sudo apt update
Then install Webmin by running the following command in Terminal:
$ sudo apt install webmin
The system will ask for confirmation by providing with Y/n option. Hit Y to confirm.
After the installation is completed, look for these lines at the end of the output:
Here, we will create an Apache virtual host to access Webmin using the domain name. We will also set up Apache to sit in front of Webmin and accept requests over port 80. Then those requests will be sent over to Webmin running on port 10000. This step will assume you have an Apache server installed already.
I will use the domain name yourdomain.tld as an example domain name below. Replace it with your own domain name wherever it occurs in the files we create below and also in the commands.
(Note: This step is not necessary if you want to access Webmin only on localhost.)
Step 1: Create a new Apache virtual host file
To create a new Apache virtual host file under /etc/apache2/sites-available/, run the following command in terminal:
$ sudo nano /etc/apache2/sites-available/yourdomain_tld.conf
Add the following lines in it:
<VirtualHost *:80> ServerAdmin [email protected] ServerName yourdomain.tld ProxyPass / http://localhost:10000/ ProxyPassReverse / http://localhost:10000/ </VirtualHost>
Replace your_email and your_domainName with your own email address and domain name.
The above configuration will allow Apache to sent requests to the Webmin server running at port 10000. Once done, use Ctrl+O to save and then Ctrl+X to exit the file.
Step 2: Stop Webmin from using TLS/SSL
In this step, we will guide Webmin to stop using SSL/TLS as Apache will provide us with that. For that, open the file miniserv.conf located at /etc/webmin/ using the following command:
$ sudo nano /etc/webmin/miniserv.conf
Find the line ssl=1 and change it to ssl=0, as shown below:
Once done, press Ctrl+O to save and Ctrl+X to exit.
Step 3: Add your domain name to the list of allowed domains
The next thing to do it to add your domain name to the list of allowed domains in the Webmin configuration. Open the file through this command:
Next, we will add our domain name to the list of allowed domains in the Webmin configuration file. To edit the configuration file, enter the following command in terminal:
$ sudo nano /etc/webmin/config
At the end of the file, add the following line:
Replace yourdomain.tld with your domain name. once done, use Ctrl+O to save and Ctrl+X to exit the file.
Step 4: Restart Webmin to apply configurations
To apply the above configuration changes, we will need to restart the Webmin service. Run the following command to do so:
$ sudo systemctl restart Webmin
Step 5: Activate the Apache proxy_http module and your Apache Virtual Host
First, enable the Apache’s proxy_http module using the following command:
$ sudo a2enmod proxy_http
Now restart the apache2 service to activate new configuration:
$ sudo systemctl restart apache2
Then enable the Apache virtual host through the following command:
$ sudo a2ensite yourdomain.tld
Finally restart the Apache2 service.
Secure Webmin with a free Let’s Encrypt SSL Certificate
To secure Webmin with a free Let’s Encrypt SSL certificate, we will install Certbot Let’s Encrypt client.
apt-get install certbot python-certbot-apache
Then run certbot command to get a free SSL certificate:
Select your Webmin website in the dialog that appears on the screen.
To access Webmin, navigate to the following address:
You will see the following login page. Log in using the root or another privileged user.
Once logged in, you will see the dashboard similar to below providing you with the basic information about your system:
So, we have learned how to install and configure Webmin on a Debian OS. Now you can use this user-friendly and web-based admin tool for administering and managing Linux servers, packages, and users on the fly! It is a really helpful tool for both aspiring and professional system administrators.