The Webmin console is your answer to on-the-fly management of Linux as an administrator. You can use any web browser to setup user accounts, Apache, DNS, file sharing, and much more. In this article, we will describe a step-by-step installation of Webmin on your Ubuntu system. We will also explain how to configure Webmin so that you can use your domain name to access Webmin through an FQDN.
The commands and procedures mentioned in this article have been run on an Ubuntu 18.04 LTS system.
Webmin Installation on Ubuntu 18.04
Since the installation of Webmin is done through the Linux Command Line, we will use the Terminal application for this purpose. In order to open the Terminal, you can either use the Ctrl+Alt+T shortcut or open it through Ubuntu Dash.
The first thing to do is to add the Webmin repository to your sources list. There are two ways to do so:
Method 1: Add Webmin Ubuntu repository
Open the /etc/apt/sources.list file to manually add the repository link to the list. In order to open the sources.list file, run the following command as root in your Terminal:
$ sudo nano /etc/apt/sources.list
This will open the file in the Nano editor. Move to the end of the file and paste the following line in order to add the Webmin repository to the list:
deb http://download.webmin.com/download/repository sarge contrib
Save and exit the file by pressing Ctrl+X and then Y for confirmation.
The next step is to get the Webmin PGP key for the newly added repository. This way the system will trust this repository. Run the following command to do so:
$ wget http://www.webmin.com/jcameron-key.asc
Then add the key through the following command:
$ sudo apt-key add jcameron-key.asc
An alternative to the manual method described above is to add the key and repository through the following method:
Enter the following command in order to download and add the Webmin repository key:
$ wget -qO- http://www.webmin.com/jcameron-key.asc | sudo apt-key add
Then use the following command in order to download the Webmin repository to the list of sources on your system:
$ sudo add-apt-repository "deb http://download.webmin.com/download/repository sarge contrib"
Installing Webmin on Ubuntu
Once the repository has been added and recognized, let us update the list of packages on our system through the following command:
$ sudo apt update
Finally, install the Webmin application through the following command:
$ sudo apt install webmin
Enter Y when prompted to continue installation.
When the installation is complete, look up for these lines at the end of the output.
This will give you information about how to access the Webmin console through your browser.
In this step, we will make Webmin accessible remotely on port 80 by creating a proxy Vhost in Apache. This step is optional and assumes that you have an Apache web server installed, if you are fine with Webmin running on Port 10000 on localhost only, then skip this chapter and continue with Accessing Webmin chapter.
Step 1: Create a new Apache virtual host file
If you want to access Webmin using an FQDN, for example, webmin.your_domainName, it is best to configure an Apache virtual host in order to proxy requests on Webmin server. Webmin uses port 10000 so we have to ensure that the port is open on the firewall.
Let us create an Apache virtual host file as follows:
Create the file through the following command:
$ sudo nano /etc/apache2/sites-available/your_domainName.conf
Enter the following script to the file:
<VirtualHost *:80> ServerAdmin your_email ServerName your_domainName ProxyPass / http://localhost:10000/ ProxyPassReverse / http://localhost:10000/ </VirtualHost>
Exit and save the file through CTrl+X and then enter Y for confirmation. This file will tell the server to pass all requests to port 10000.
Note: In case UFW is enabled on your system, you can allow incoming traffic from any source to TCP port 10000 using the following command:
sudo ufw allow from any to any port 10000 proto tcp
Step 2: Stop Webmin from using TLS/SSL
The next step is to tell Webmin to stop using TLS/SSL as we will later configure Apache for this purpose. Run the following command in order to access the miniserv.conf file:
$ sudo nano /etc/webmin/miniserv.conf
Spot the line ssl=1 and change it to ssl=0, as follows:
Exit the file through Ctrl+X then save changes by entering Y.
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:
$ sudo nano /etc/webmin/config
Move to the end of the file and add the following line to allow your domain name:
Step 4: Restart Webmin to apply configurations
Use the following command in order to restart Webmin. This will apply all the configurations that you have made in the previous steps:
$ sudo systemctl restart webmin
Step 5: Activate the Apache proxy_http module and your Apache Virtual Host
Run the following command in order to Apache’s proxy_http module:
$ sudo a2enmod proxy_http
Then activate your newly created Apache virtual host through this command:
$ sudo a2ensite your_domain
Finally, this command will activate the Apache proxy_hhtp module along with your virtual host:
$ sudo systemctl restart apache2
In order to access Webmin, open your browser and use the following links:
- http://linux:10000 (This is the link you got from the output when the Webmininstallation was complete)
- http://your_domanName (This is the link you will use if you have configured Webmin through the above-mentioned process)
The Webmin interface will open as follows; you can log in as root or another privileged user as follows:
You can manage users and update packages, among many other things, through this Webmin console:
Through this article, you got an in-detail information about installing Webmin on your system and configuring it for your domain. You can now use it for managing servers, packages, and users on the fly!