Webmin is a versatile, web-based application for managing Linux-based operating systems, perfect for users who prefer web interfaces over command line interactions. With Webmin, you can edit configuration files, set up web and FTP servers, run commands, manage email forwarding, and handle various administrative tasks—all through a web browser. It provides a user-friendly interface for managing remote Linux systems effortlessly.
In this guide, we will walk you through installing Webmin and securing it with Let’s Encrypt on a server running Ubuntu 24.04.
Prerequisites
- A server running Ubuntu 24.04
- A valid domain name pointed to your server
- A root password configured on your server
Getting Started
Before starting, it’s wise to update your system’s packages to their latest versions. Run the following commands to do so:
apt update -y
apt upgrade -y
Once the update and upgrade are complete, reboot your system to apply all changes:
reboot
Install Webmin on Ubuntu 24.04
Since Webmin is not included in Ubuntu’s default repositories, you must add the Webmin repository to your system manually.
First, install the necessary packages with this command:
apt install software-properties-common apt-transport-https wget -y
Then, import the Webmin GPG key using the following command:
wget -q http://www.webmin.com/jcameron-key.asc -O- | apt-key add -
Add the Webmin repository to your system:
add-apt-repository "deb [arch=amd64] http://download.webmin.com/download/repository sarge contrib"
After adding the repository, install Webmin with this command:
apt install webmin -y
Once installed, verify Webmin’s service status with:
systemctl status webmin
A successfully running Webmin service will produce output like:
? webmin.service - Webmin server daemon Loaded: loaded (/lib/systemd/system/webmin.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2024-08-30 07:32:41 UTC; 42s ago Process: 58866 ExecStart=/usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf (code=exited, status=0/SUCCESS) Main PID: 58867 (miniserv.pl) Tasks: 1 (limit: 4579) Memory: 27.8M CPU: 644ms CGroup: /system.slice/webmin.service ??58867 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf Aug 30 07:32:38 ubuntu2404 systemd[1]: Starting Webmin server daemon... Aug 30 07:32:41 ubuntu2404 webmin[58866]: Webmin starting Aug 30 07:32:41 ubuntu2404 systemd[1]: Started Webmin server daemon.
To stop the Webmin service, execute:
systemctl stop webmin
Webmin should now be installed and listening on port 10000. Verify with this command:
ss -antpl
You should see an output showing Webmin listening on port 10000:
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 4096 0.0.0.0:10000 0.0.0.0:* users:(("miniserv.pl",pid=58867,fd=5))
Access Webmin Web UI
Open a web browser and visit https://your-ip-address:10000. You’ll encounter a warning regarding an untrusted SSL certificate since Webmin uses a self-signed certificate by default:
Proceed past this warning to reach the Webmin login page:
Enter your root username and password, then click Sign in to access the Webmin dashboard:
Using Webmin
Webmin facilitates several administrative tasks on your Linux system. Below, we will demonstrate how to update packages, install Git, and create a new user using the Webmin interface.
Install and Update Packages
Installing or updating packages with Webmin is straightforward.
To install the net-tools package, navigate to System > Software Packages. You will see this screen:
Select “Package from APT“, enter net-tools, and click Install. The package will install, confirmed by the following screen:
Create and Manage Users
Webmin allows easy creation, editing, and deletion of user accounts.
To create a new user, go to System > Users and Groups. The following screen will appear:
Click Create a new user. The Create User screen will display:
Fill in the username, set User ID to Automatic, provide the Real Name, choose Automatic for the Home Directory, and select Normal Password. Enter your password then click Create. The new user appears in the user list:
Enable SSL on Webmin
While Webmin uses a self-signed SSL certificate by default, it’s advisable to secure it using a trusted SSL certificate from Let’s Encrypt.
Start by installing Apache and Certbot:
apt-get install apache2 certbot python3-certbot-apache -y
Post-installation, start the Apache service and enable it for startup on boot:
systemctl start apache2
systemctl enable apache2
Confirm Apache’s status:
systemctl status apache2
The expected active status output for Apache is:
? apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2024-08-30 07:47:13 UTC; 11s ago Docs: https://httpd.apache.org/docs/2.4/ Main PID: 62034 (apache2) Tasks: 55 (limit: 4579) Memory: 5.1M CPU: 39ms CGroup: /system.slice/apache2.service ??62034 /usr/sbin/apache2 -k start ??62038 /usr/sbin/apache2 -k start ??62039 /usr/sbin/apache2 -k start Aug 30 07:47:12 webmin.linuxbuz.com systemd[1]: Starting The Apache HTTP Server... Aug 30 07:47:13 webmin.linuxbuz.com systemd[1]: Started The Apache HTTP Server.
Within Webmin, navigate to Networking > Network Configuration, then select Hostname and DNS. The window below should appear:
Enter your fully qualified domain name in the hostname field and click Save to apply.
Next, access the Webmin > Webmin Configuration menu. The following screen appears:
Click SSL Encryption to modify SSL settings:
In the Let’s Encrypt tab, input your domain in the Hostnames field, indicate the website root directory in the Other directory fields, and click Request Certificate to fetch and apply the SSL certificate.
Finally, log out of Webmin and log back in using the secure URL: https://webmin.yourdomain.com.
Conclusion
Congratulations! You’ve successfully installed Webmin and secured it with a Let’s Encrypt SSL certificate on Ubuntu 24.04. Webmin now provides you with a convenient, web-based platform for managing your Linux systems. For any assistance, feel free to reach out with questions.
FAQ
Q: Is Webmin free to use?
A: Yes, Webmin is a free and open-source tool for web-based system management.
Q: Can I access Webmin from any network?
A: By default, Webmin listens on all interfaces. Ensure firewall rules permit access from your remote network to Webmin’s port.
Q: What are the default login credentials for Webmin?
A: Upon installation, Webmin uses the system’s root username and password. It is advisable to create a specific administrative user for security purposes.
Q: How do I update Webmin?
A: Update Webmin via the Webmin Configuration module under the Webmin menu or use the apt upgrade
command if installed via APT.
Q: Is it safe to use Webmin’s self-signed SSL certificate?
A: While functional, a self-signed certificate produces browser warnings and lacks third-party verification. Utilizing a trusted certificate from Let’s Encrypt enhances security.