Virtualmin is a powerful and user-friendly web hosting control panel that allows you to manage multiple websites and domains from a single interface. It simplifies various administrative tasks, making web hosting management accessible even to those without extensive technical knowledge.
In this blog post, we will walk you through installing Virtualmin on Ubuntu 22.04, step by step.
- A fresh installation of Ubuntu 22.04.
- A user with sudo privileges.
- A registered DNS domain (i.e., lazyexchangeadmin.cyou)
- A public DNS record pointed to your Virtualmin server (i.e., virtualmin.lazyexchangeadmin.cyou → 184.108.40.206)
Step 1: Download the Ubuntu Virtualmin Installation Script
Before we begin, ensure you have a freshly installed Ubuntu 22.04 server with root access. Starting with a clean slate is crucial to avoid any conflicts or compatibility issues during the installation.
To get started, log in to your Ubuntu server via SSH. Once you are in, you can download the Virtualmin Ubuntu installation script using the following command:
Step 2: Install Virtualmin on Ubuntu 22.04
After downloading the Virtualmin Ubuntu installation script, you must make it executable before running it. Use the following command to set the appropriate permissions:
chmod +x install.sh
List the script and confirm it is now executable.
ls -l install.sh
As you can see, the script has the ‘x’ bit, which confirms it is an executable.
Now, run the installation script with root privileges to initiate the Virtualmin Ubuntu installation process:
You’ll see the “Welcome” message that tells you which systems are currently supported by the script. As you can see, Ubuntu 22.04 is listed. Press y and Enter to continue.
The installation process might take some time as it downloads and configures various dependencies required for Virtualmin Ubuntu to function correctly. You might be prompted to provide information and confirm specific settings during the installation. Make sure to review and respond to these prompts carefully.
Step 3: Open Virtualmin WebUI in the Firewall
Once the installation is complete, you must open the ports in your server’s firewall to access the Virtualmin Ubuntu WebUI. By default, Virtualmin uses port 10000 for web access.
To open port 10000 using the UFW firewall, execute the following commands:
sudo ufw allow 10000/tcp sudo ufw reload
Now, you can access the Virtualmin WebUI by navigating to https://your-server-ip:10000 in your web browser.
Note. You must allow the same port in your perimeter firewall(s) if you’re accessing the Virtualmin WebUI from outside the network.
Step 4: Virtualmin Post-Installation Setup
Congratulations! You have successfully installed Virtualmin on your Ubuntu 22.04 server. However, before you start using it to host websites, you should perform a few post-installation setup steps.
The first time you access the Virtualmin WebUI, you’ll get the following security warning because of an invalid SSL certificate. Click Advanced and “Proceed to …”
Log in using your admin credentials.
You’ll be greeted with the Post-Installation Wizard by default. Click Next.
Next, choose the memory optimization options for your server. This selection is based on your assessment of how the server will be used. In this example, I’ll choose Yes to both “Preload Virtualmin libraries?” and “Run email domain lookup server?” settings and click Next.
Choose whether to enable virus scanning with ClamAV. If your server is not hosting emails, choose the “No, email will not be filtered” option and click Next.
On the next page, choose which database servers to run. You can run both or none, depending on which websites you plan to host. In most cases, MariaDB is sufficient, but there are web applications that may also require PostgreSQL. If the server does not host websites, then you don’t need to run either database server.
Next, copy the new MariaDB root password or set your own, and click Next.
Specify the primary nameserver and click Next.
The wizard tests the NS resolvability. If the DNS resolution test passed, click Next to continue the configuration.
Choose whether to store the virtual server and mailbox passwords as plain-text or hashed (one-way encrypted).
- Plain-text passwords are not secure and can be read by anyone, especially if the server is compromised.
- Hashed passwords are one-way encrypted (no decryption keys), making them secure but not recoverable.
Depending on how you expect the database will be used, choose the MariaDB configuration size and click Next.
Note. The “Suggested” option varies based on your system resources.
Select the location for SSL certificates. You can choose to store them in each domain’s home directory (i.e., /home/<domain>) or per-domain directory under ‘/etc/ssl/virtualmin’.
Choose whether to set up a default virtual server and enter the server FQDN.
Select whether to enable SSL on the default server. You can enable it but install the SSL certificate manually later or let the server acquire and install the certificate from Let’s Encrypt.
Note. By default, Virtualmin uses a self-signed SSL certificate for encryption. While this is sufficient for testing and initial setup, using a valid SSL certificate from a trusted Certificate Authority is recommended to ensure secure connections.
If all goes well, the post-installation configuration will be completed. Click Finish.
Finally, click the “Re-check and refresh configuration” button to reload and apply the changes you made.
Wait for the “Checking Configuration” process to finish. You will see a screen similar to the screenshot below. Once finished, click the “Return to virtual servers list” button.
The default virtual server is now listed.
To test if this website works, open a new web browser and navigate to its URL. The website should load and is secured with a valid SSL certificate from Let’s Encrypt. How easy is that?
Do not confuse the default virtual server with the Virtualmin server.
The Virtualmin (Webmin) server is the administration interface you can access through the https://URL:10000 address.
The default virtual server hosts the website, which you can access via http://URL (without the 10000 port number).
Virtualmin on Ubuntu 22.04 provides a robust and easy-to-use web hosting control panel. Its comprehensive features and user-friendly interface make managing multiple websites a breeze.
Just follow the steps outlined in this guide, and you’ll have Virtualmin up and running in no time, and you’re on your way to creating new virtual servers!