
Virtualmin is an open-source web hosting control panel for Linux and UNIX systems. It allows managing multiple domains, email accounts, databases, DNS, and applications through a single interface. Virtualmin supports various web servers, databases, and mail applications, offering advanced monitoring and alerting tools for server resources and website performance.
This article explains how to install Virtualmin on Ubuntu 22.04, create a virtual host web application, and secure it with Let's Encrypt SSL certificates.
virtualmin.example.com.Virtualmin is not available in Ubuntu 22.04's default repositories. Follow the steps below to download and install Virtualmin using the latest installation script.
Set your domain as the new server hostname. For example, virtualmin.example.com.
Download and run the Virtualmin installation script. The command below installs the open source (GPL) edition of Virtualmin with the LAMP stack.
Enter Y to proceed with the installation.
Wait for at least 5 to 10 minutes for the installation to complete.
Follow the steps below to generate trusted Let's Encrypt SSL certificates and secure the Virtualmin web administration interface.
Stop the Apache service to ensure Certbot can bind to port 80.
Install the Certbot package Let's Encrypt client to manage your SSL certificates.
Request a new SSL certificate using your domain. Replace virtualmin.example.com and virtualmin@example.com with your actual details.
If a certificate already exists, Certbot displays a prompt:
The above output means you have a valid SSL certificate. Select 1 to keep the current certificate and exit.
If no prompt appears, Certbot will request a new certificate. Follow the instructions until you receive a success message confirming the certificate has been issued.
After obtaining the certificate, create a bundle by concatenating the certificate and private key, then update the keyfile directive in the /etc/webmin/miniserv.conf file to point to the bundled file.
Open the miniserv.conf configuration file.
Update the following line.
Restart the Webmin service to apply your configuration changes.
View the status of Webmin service and verify that it is running.
Your output should be similar to the one below:
Start the Apache service.
View the status of Apache service.
Your output should be similar to the one below:
Virtualmin uses the firewalld utility to manage firewall processes. Follow the steps below to allow necessary Virtualmin ports and services through the firewall.
View the firewalld service status and verify that it's running.
Output:
View all allowed ports in the firewall configuration.
Output:
View all allowed services.
Output:
Virtualmin runs on the default TCP port 10000 by default. Follow the steos below to access the Virtualmin web administration interface and create a new virtual server.
Access your domain on port 10000 to open the Virtualmin control panel interface.
Enter your sudo user account details to log in to the Virtualmin interface.
Click Next within the Post-Installation Wizard to set up any additional configurations on your server.
Find and click Dashboard on the left navigation bar to access the system performance page.
2-factor authentication (2FA) enhances security by requiring a one-time code from your mobile device. Follow the steps below to enable 2FA for Virtualmin using Google Authenticator.
Scroll down on the left navigation bar and click your username at the bottom of the page.
Expand the Security and limits options section.
Click Enable Two-Factor For User.
Click Enroll For Two-Factor Authentication.
Scan the displayed QR code on the page with your authenticator application.
Scroll down on the left navigation bar to log out of Virtualmin.
Log in with your non-root user credentials to test 2FA.
Verify that Virtualmin requires the 2FA token to log in.
Enter the 2FA token from the app.
Press Verify to log in to the Virtualmin web administration interface.
In this article, you installed Virtualmin, created a website with automatic HTTPS via Let's Encrypt, and secured it with 2FA. You also configured the Virtualmin firewall and closed unnecessary ports. For more details, visit the official documentation.
0 Comments
Be the first to comment and share your perspective with the community.