Installing Virtualmin on Ubuntu and CentOS

Install configure Virtualmin on Ubuntu 20.04/22.04 LTS or CentOS 7  RHEL RedHat


Virtualmin is a powerful web hosting control panel that allows you to easily manage domains, websites, email accounts, databases and more on a Linux server. It provides a simple and intuitive web interface to configure and administer your server.

In this guide, we will go through the steps to install Virtualmin on the two most popular Linux distributions – Ubuntu and CentOS 7.


Before starting the installation, make sure your server meets the following requirements:

  • A freshly installed Ubuntu 20.04/22.04 LTS or CentOS 7 with minimal installation
  • At least 1GB RAM (2GB recommended)
  • At least 10GB free disk space
  • Valid hostname and FQDN configured
  • OpenSSH server installed
  • Sudo privileges for non-root user (for Ubuntu)

Step 1 – Install Dependencies

Virtualmin requires a bunch of packages and modules to function properly. We will install those first.

On Ubuntu

Run the following commands as root or user with sudo access to install the dependencies:

$ sudo apt update
$ sudo apt install -y wget perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

Next, enable the Universe repository:

$ sudo add-apt-repository universe

Install a few more packages:

$ sudo apt install -y libnet-dns-perl libnet-ldap-perl libnet-dns-sec-perl libnet-ip-perl libplrpc-perl libjson-xs-perl

On CentOS

Enable the EPEL repository:

$ sudo yum install -y epel-release

Install the dependencies:

$ sudo yum install -y wget perl perl-Net-SSLeay openssl pam pam-devel perl-IO-Tty perl-libwww-perl libtool-ltdl rsync gawk 
$ sudo yum install -y perl-Net-DNS perl-Sys-Syslog perl-LWP-Protocol-https perl-Net-IP perl-Encode-Detect 

Install a few more packages:

$ sudo yum install -y perl-JSON-XS perl-Net-DNS perl-LDAP

Step 2 – Download and Install Virtualmin

Now we are ready to install Virtualmin itself.

Download the installation script:

$ wget

Run the script to install Virtualmin:

$ sudo sh

The script will detect your OS distribution and install the appropriate version of Virtualmin. Follow the prompts during installation and enter any requested information like license key, hostname etc.

Once done, Virtualmin will be installed and ready to use!

The installation script provides a bunch of useful options as well:

--bundle LAMP|LEMP          Install LAMP (Apache) or LEMP (Nginx) stack
--minimal                  Install a minimal set of packages
--skip-os-upgrade          Skip upgrading system packages 
--unattended               Run installation unattended without prompts
--reinstall                Reinstall Virtualmin

For example, to install a minimal Virtualmin with Nginx on Ubuntu:

$ sudo sh --bundle LEMP --minimal

Step 3 – Access Virtualmin Web Interface

Virtualmin runs a web interface on port 10000. To access it:

  • Go to https://server_ip:10000 or
  • Login with username as root or any user with sudo privileges.
  • You’ll be greeted with a setup wizard to configure basic settings.
  • Once done, you’ll be taken to the Virtualmin dashboard.

Step 4 – Initial Configuration

After installing Virtualmin, there are some initial configurations that needs to be completed before using it.

Configure Networking

Under Virtualmin > System Info > Networking, configure your server’s networking as per your requirements.

Important settings:

  • Hostname and DNS domain
  • Valid IP addresses for the server
  • External IP for accessing Virtualmin externally
  • Disabling any inactive network interfaces

Configure SSL Certificate

By default, Virtualmin uses a self-signed SSL certificate. It is recommended to install a valid SSL/TLS certificate from a trusted Certification Authority.

To add a custom SSL certificate:

  • Go to Virtualmin > System Info > SSL Certificate
  • Select the Custom SSL Certificate option
  • Paste your certificate, key and any intermediate chain certs.
  • Click Save.

Configure Mail Relay Host

For sending outgoing mails from your server, relaying via a proper mail server is recommended instead of sending directly.

Under Virtualmin > System Info > Mail, set the Outgoing Mail Relay Host to your mail server like Office365, Gmail, your ISP’s mail server etc.

Review Configuration

Finally, go to Virtualmin dashboard and click on Check Configuration button. This will validate if everything is setup properly and provide tips to resolve any issues.

With this, your Virtualmin installation is complete!

Using Virtualmin

Now that Virtualmin is installed and configured, you can start using it to manage your web hosting environment. Here are some common tasks you can perform:

  • Add domains – Create new domains and manage all aspects like DNS zones, websites, databases etc.
  • Manage websites – Add and configure websites for domains with options for PHP versions, certificates, directories etc.
  • Create email accounts – Add unlimited email accounts for your domains. Configure forwarding, authentication, spam filters etc.
  • Manage databases – Add MySQL/MariaDB databases for domains and users. Manage user permissions, import and backup databases.
  • Monitor usage – Check disk usage, bandwidth, traffic etc for domains and users. Setup alerts and quotas.
  • Automate tasks – Schedule backups, system upgrades, command executions using the cron manager.
  • Manage servers – Install and patch software, configure system services like Apache, DNS, mail etc.
  • Secure access – Manage users, groups and access control lists for resources.

Refer to the Virtualmin documentation for more details on all the available features and how to use them.

And that’s it! With Virtualmin installed, you can now easily manage your web hosting environment through a simple and powerful web interface.


This guide provides a step-by-step process for installing Virtualmin on Ubuntu and CentOS 7 – two of the most common Linux distributions. By following the instructions, you can get Virtualmin up and running with its powerful web hosting control panel that simplifies server administration. A few minor additional configurations post-install completes the setup.

With Virtualmin, even beginners can effortlessly manage multiple websites, email accounts, databases and more on a Linux system through an easy-to-use web interface. It is an invaluable tool for efficiently delivering hosting services on VPS or dedicated servers.