How to Install Virtualmin in Ubuntu 22.04?

Introduction:

Welcome to the world of control panel management with Virtualmin and Webmin. Virtualmin specializes in managing virtual servers (domains), domains, and users, while Webmin provides a user-friendly web-based interface for a seamless system administration experience. Virtualmin is a plugin for Webmin designed to simplify the management of several virtual hosts through one easy interface. Virtualmin allows you to handle tasks such as managing user accounts, Apache virtual hosts, DNS entries, MySQL databases, mailboxes, and more.

This tutorial guides you through installing the free edition of Virtualmin, known as Virtualmin GPL. The installation script covers everything you need, including Webmin.

Note: It's important not to follow this tutorial on a live production server already running Apache, MySQL, and PHP, as it could lead to data loss. Instead, use a new and fresh server only.

Prerequisites:

Make sure you have the following:

  1. New & Fresh Ubuntu 22.04 Server
  2. Minimum of 1GB RAM
  3. Fully-Qualified Domain Name (FQDN) (How to Setup Hostname)
  4. Custom Nameservers for Virtualmin (How to Create Custom Nameservers)
  5. Root or sudo access

These prerequisites ensure a smooth process with the tutorial.

Step 1: Update Your Server

Begin by keeping your system up-to-date. Running the following commands will ensure that you have the latest packages and security patches:

sudo apt update && sudo apt upgrade -y

This step is crucial for maintaining a secure and stable environment for Virtualmin installation

Step 2: Change/Setup Hostname

A proper hostname is essential for server identification and communication. Set up or change your server’s hostname using the following command (Change yourhostname to the actual hostname):

sudo hostnamectl set-hostname yourhostname

Choosing a meaningful hostname contributes to better organization and clarity in your server environment. Learn more about setup hostname

Step 3: Install Wget and Screen

sudo apt install wget screen -y

Learn more about using Screen, a powerful tool for managing terminal sessions.

Step 4: Use Screen

With Screen initiated, you can ensure that your Virtualmin installation process remains uninterrupted, even if your connection is lost. Start a new screen session:

screen

Step 5: Install Virtualmin

Now comes the core of our setup – the installation of Virtualmin. Download and execute the Virtualmin installation script to start the process:

wget http://software.virtualmin.com/gpl/scripts/install.sh
sudo bash install.sh

Note:
During the installation, ensure a stable internet connection to avoid interruptions.

Step 6: Change SSH Port (Optional)

Secure your server by changing the default SSH port. Edit the SSH configuration file:

sudo nano /etc/ssh/sshd_config

Change the Port to your desired number and restart SSH:

sudo service ssh restart

Learn more about the importance of changing SSH port for enhanced security.

Warning:
Changing the SSH port will interrupt your current SSH connection. Ensure you have alternative means of access or are prepared for a temporary loss of connection.

Step 7: Change Webmin and Usermin Port (Optional)

Extend your security measures by adjusting the Webmin and Usermin ports. Open the respective configuration files:

sudo nano /etc/webmin/miniserv.conf
sudo nano /etc/usermin/miniserv.conf

Change the port and listen variable, then restart Webmin and Usermin:

sudo service webmin restart
sudo service usermin restart

Learn more about configuring Webmin ports for additional security.

Step 8: Configuring Webmin’s Root Password

Execute the following command:

sudo /usr/share/webmin/changepass.pl /etc/webmin root yournewpassword

Step 9: Install Firewall

Install and configure UFW:

sudo apt install ufw -y
sudo ufw allow    # Allow New SSH Ports
sudo ufw allow    # Allow New Webmin Ports
sudo ufw allow    # Allow New Usermin Ports
sudo ufw enable

Learn more about the significance of installing UFW for secure your server.

Step 10: Post-Installation Wizard

Complete the Virtualmin post-installation setup by accessing:

https://yourserverip:10000

Follow the wizard to configure your system.

Click the “Next” button.

Select the needed setting for your system or Leave it to Default setting and Click “Next”

Choose whether you want to run ClamAV in the background or leave it to default setting, then click “Next.”

Choose whether you want to run SpamAssassin in the background or leave it to default setting, then click “Next.”

Choose whether you want to use a MySQL server, or a PostgreSQL server, then click “Next.”

Set a root password for the database server, remove the test MySQL database and anonymous MySQL user, then click “Next.”

Choose the settings as per your need or leave it to default setting, then click “Next.”

Enter the both nameservers, then click “Next”.

Choose whether to store the password as plain text or in hashed form, then click “Next.”

The Post-Installation Wizard is now completed.

Conclusion:

In conclusion, the installation of Virtualmin on Ubuntu 22.04 has been successfully completed. With Virtualmin, you now have a powerful and user-friendly web hosting control panel at your disposal. This platform simplifies server management, making it easier to deploy and manage websites, email, and other web applications. As you embark on utilizing Virtualmin for your hosting needs, explore its comprehensive features to optimize server performance and enhance your overall web hosting experience on Ubuntu 22.04.


Leave a Reply

Your email address will not be published. Required fields are marked *