How to Install Webmin on Debian/Ubuntu?

In this tutorial, we will learn how to install Webmin on Debian/Ubuntu.

What is Webmin?

If you are comfortable with a GUI framework then Webmin is suitable for you. Webmin is a web-interface used for system administration for Unix/Linux operating system.

To set up the user accounts, Apache, DNS, file sharing and so on you need to run commands on CLI i.e. Command Line Interface. If you want to get rid of this, or you find difficult to learn the commands, Webmin is the best option for you.

When you install Webmin on Debian/Ubuntu or any Linux OS, it provides a web-interface through which you can create users, set user permissions, do configurations and so on. There are many modules in Webmin. This is a centralized place where you can manage all the other servers using Webmin. Note that there is individual Webmin for individual servers.

How do we use Webmin?

Login into the Webmin server using the web browser. Do the configurations using Console or remotely. Webmin is based on Perl. Its default port number is 10000.

Let’s discuss how to install Webmin on Debian/Ubuntu server.

Steps to Install Webmin on Debian/Ubuntu

1. Update the Repositories

The first step is to update and upgrade the repositories. Updating repositories means refreshing the packages while upgrading means to install the latest versions of the packages.

We will use the apt command to install and update the packages. Earlier we used to have apt-get command to do so, but now we are using apt to do the same. The apt command is the new command and the functions of apt-get and apt-cache have been combined into apt. There is a difference between apt and apt-get. Let’s update the repositories and upgrade the packages.

sudo apt update && apt upgrade

2. Install the Dependencies

Webmin requires some of the prerequisites needed to be installed before downloading it. These can also be considered as dependencies. These are the Perl dependencies. We will use the apt command to install Webmin on Debian along with all the dependencies.

Folks, This step is important so make sure to install them properly. Run the following command after updating the packages successfully.

sudo apt install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

3. Add the Webmin Repository

After successfully installing the dependencies, the next step is to add the link of the Webmin repository in the sources.list file to install Webmin on Debian correctly. You would find this file in /etc/apt directory. You can use any editor either vi or nano.

It depends on you. Remember if you use the vi editor, use “:wq” to save and exit the changes. If you are using simple text editor through nano command, use Ctrl + O to save and Ctrl + X to exit. Here, I am using a simple text editor. Paste the following code described after the command:

sudo nano /etc/apt/sources.list

Paste the following code:

deb https://download.webmin.com/download/repository sarge contrib
Edit The Soucelist Step1
Edit the code

4. Install the Webmin package

After successfully adding the link in the source list file, the next step is to Webmin on Debian/Ubuntu using the official package. But before this, we need to install the GPG Key. Basically, GPG keys are the Gnu privacy guard key which is used as belongings to verify whether the developer has joined the project or not.

We will download the jcameron key using wget command and add the downloaded key using the apt command. Let’s have a look at the command below:

wget https://download.webmin.com/jcameron-key.asc
Download Key Step3
Download the Key

Now, add the key using the apt command. It should respond with OK. The code for this is as follows:

sudo apt-key add jcameron-key.asc
Add Key Step 2
Add the Key

After adding the keys, just update the repositories again using apt update command as given below:

sudo apt update

Folks, make sure you have downloaded the HTTPS server. The next step is to download and install Webmin on Debian using the official package. We have made all the necessary configurations regarding this. Here, we will use the apt command to install the webmin package. Let’s have a look at the command below:

apt install webmin
Install Webmin
Install Webmin

It will successfully install Webmin on Debian.

How to Start the Webmin Service?

After you successfully install Webmin on Debian, we need to start the service of the package. For this, we will use systemctl command using start keyword. Let’s have a look at the command below:

systemctl start webmin

This command will successfully start the services.

Checking the Status of Webmin service

After successfully starting the service, what if we want to check the status of the Webmin that whether it is running successfully or not. For this, we will use systemctl command with the status keyword. The command for this is as follows:

systemctl status webmin 
Check Status
Check the Status

Adding Webmin Ports to Debian/Ubuntu Firewall

As discussed earlier, to access the Webmin server you need to access the web browser through port number 10000. By default, it uses port number 10000. If the port is disabled, allow it using the ufw firewall:

sudo ufw allow 10000/tcp

Here we are adjusting the firewall i.e. opening the Webmin port to access the services. After successfully enabling the services, we will access the web browser using the IP address. The command for this is as follows:

http://localhost:10000/

You would see the following window:

Login Form
Login Form

Sign in by adding up the credentials as same you use while logging in the system i.e. root or your personal user creds. After this, the dashboard will appear as follows:

Dashboard 1
Dashboard

That’s it. We have successfully installed Webmin and accessed it through browser.

Uninstalling Webmin from Debian/Ubuntu

We have learned how to install Webmin on Debian/Ubuntu, but we should also know how to remove it. Here, we will use remove command with –purge option to remove the Webmin package. The command for this is as follows:

apt-get --purge remove webmin
Remove Webmin
Remove Webmin

Conclusion

We have successfully learned how to install Webmin in Debian/Ubuntu. If you face any issues, do let us know in the comment section.