Administering a server can be a daunting task. The good news is, there are plenty of tools available to make the job easier. One of these tools is Webmin. This tutorial shows how to install Webmin on an Ubuntu Linux server.
What Is Webmin?
Webmin is a web-based interface for system administration in Unix. It is similar to cPanel and Plesk but is free and open source. Use it to set up user accounts, Apache, DNS, file sharing and much more.
Webmin removes the need to manually edit Unix configuration files and lets you easily manage a system. This can save you a lot of time, especially if you are not familiar with the command line or need to provide web-based access to server administration for multiple users.
Webmin can also be used to monitor multiple servers from a single location. This is very handy if you are responsible for managing a large number of servers.
Adding Webmin Repository
Before we start, it is good to first update and upgrade the system.
sudo apt update && sudo apt -y upgrade
Next, install the dependencies for Webmin:
sudo apt install software-properties-common apt-transport-https wget -y.
Add the Webmin repository to the system:
sudo wget -q http://www.webmin.com/jcameron-key.asc -O- | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] sarge contrib"
Finally, install Webmin with the command:
sudo apt install webmin -y
Once the installation completes, run the
systemctl commands to start and enable the Webmin service.
sudo systemctl start webmin sudo systemctl enable webmin
Check the status of the Webmin service to ensure that it is up and running.
sudo systemctl status webmin
You will see an output similar to the following, which indicates that the service is up and running.
The Webmin service listens on port 10000 by default. Run the
ss command to check whether it is listening.
sudo ss -ltn | grep :10000
You will see an output similar to the following that indicates that the service is listening on port 10000.
Accessing the Webmin Web UI
To access the Webmin web interface, navigate to your server’s IP address followed by :10000 in your web browser:
The first time you access the Webmin interface you will see a warning as shown below, as the SSL certificate used by Webmin is self-signed.
We will fix that later. For now, you can safely ignore this message and click on the “Advanced” button.
Click “Accept the Risk and Continue” on the next page to access the Webmin login page.
You will see the login page as shown. Use the credentials for your root user and click “Sign in” to log in to Webmin.
Remember, you must use the credentials for your root user. If you want to log in as a non-root user, you will have to edit the “/etc/webmin/config” file.
After logging in, you will see the Webmin dashboard, as shown below, where you can configure various aspects of your Ubuntu system from the Webmin web interface.
Securing Webmin With SSL
- First, run the following command to install the Apache web server and the Let’s Encrypt Certbot tool. We are using
certbot, a tool that automates the process of setting up SSL certificates to generate and renew Let’s Encrypt SSL certificates.
sudo apt install apache2 certbot python3-certbot-apache -y
Start and enable the apache service.
sudo systemctl start apache2 sudo systemctl enable apache2
Check the status of the apache service.
sudo systemctl status apache2
The best way to check whether the apache service is up and running is to request a web page from the server by visiting the server’s IP address in your web browser.
You will see the Apache2 Ubuntu Default Page, as shown below, signifying that the apache2 service is up and running successfully.
Tip: you can also learn how to configure Apache and PHP for a high traffic site.
Next up is configuring a hostname for our Webmin server. A hostname is a human-readable name used to identify a device on a network.
- Navigate back to the web browser where you accessed the Webmin web interface earlier.
- Select “Networking -> “Network Configuration -> Hostname and DNS Client.”
- On the next page, enter the FQDN of your server in the “Hostname” field. FQDN stands for Fully Qualified Domain Name, the complete domain name of a device. Keep other settings as is and click “Save” to save the configuration.
- Still on the Webmin web interface, click on “Webmin -> Webmin Configuration -> SSL Encryption.”
- Select the Let’s Encrypt tab and configure the following:
- Hostnames for certificate: enter the FQDN of your Webmin server. This is the same hostname that we configured earlier.
- Website root directory for validation file: select the “Other directory” option and enter “/var/www/html” in the input field. This is the root directory of our Apache web server.
- Months between automatic renewal: enter 1 in the input field, which will cause the SSL certificate to be automatically renewed one month before it expires.
Keep other settings as is and click “Request Certificate” to generate the SSL certificate from Let’s Encrypt.
You will see a message that says the certificate has been successfully generated as shown.
- Now that the SSL certificate has been generated, we will test it to make sure it is working properly. On a new browser tab, visit the URL https://your_server_ip:10000. You will see the same Webmin login page as before, but this time it will be served over a secure HTTPS connection.
You can also check the secure connection of the SSL certificate by clicking on the lock icon next to the URL as shown.
Create a New User With Webmin
One of the most basic tasks that an admin needs to do is create new user accounts. With Webmin, this can be easily accomplished from the web interface.
By default, only the root user has administrative privileges on Ubuntu, so only the root user can install new software, create new users, and modify system settings.
It is considered best practice to avoid using the root user for daily tasks. Instead, create a new user with sudo privileges and use that account for your daily tasks.
- Navigate to “System -> Users and Groups -> Create a new user.”
- Configure the following basic settings for the user account:
- Username: enter a username for the new user. You can enter any name you want, but it must not be the same as any existing username. The name should be 1 to 32 characters long and can only contain letters, numbers, periods (.), underscores (_), and dashes (-).
- Real name: optionally, enter the user’s real name, which can be useful for identifying the user later on.
- Click “Create” at the bottom to create the user.
Once the user has been created, you will see your newly-created user in the list of users, as shown below.
Install a New Package in Webmin
Another important task performed using Webmin is installing a new software package on your system. The web UI helps you find, install, and remove software packages on your system with ease.
- Navigate to “System -> Software Packages.”
- In the “Package from APT” field, type in the name of the package you want to install in the search box and click on “Install.” In this case, we are installing the “net-tools” package.
- On the next screen, click “Install Now” to confirm the installation.
Once the package is installed, you will see an output similar to the one below.
Frequently Asked Questions
What should I do if I have lost my root password and cannot log in to the server?
You can easily reset your root password with the command:
/usr/libexec/webmin/changepass.pl /etc/webmin admin password123
This command changes the password for the admin user to “password123.” Replace “admin” with your actual root username.
Why do I still get the « not secure warning » in my browser when I try to access Webmin after configuring SSL?
Ensure that you go to in your browser and not http://your_domain:10000. The extra “s” in https is important, as it tells the browser to use a secure connection.
How can I uninstall Webmin from my server?
To uninstall Webmin, run the command
/etc/webmin/uninstall.sh to remove all traces of Webmin from your server.
Image credit: Webmin. All screenshots by Nicholas Xuan Nguyen.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox