Automated Virtualmin Installation

Tags: 

Recommended System Specifications

  • Automated installation requires a freshly installed, supported OS.
  • 1 GB RAM (less for the --minimal installation), more is better
  • 1 GB free disk space, more for your domain data

Installation

There are two methods for installing Virtualmin. The first is a fully automated script described in this document, and the other is a manual installation documented in the Manual Virtualmin Installation page. When possible, the automated installation described here is highly recommended, as it removes many possible errors during configuration and insures that all applications are built with appropriate options for virtual hosting within the Virtualmin system. If you haven't read the Download page yet, you should do so now, as it provides all of the steps needed for installation in most cases on a single page. You should only proceed to more complex installation docs, if the steps provided on the download page won't work for you.

Automated installation with install.sh

In most cases, installing Virtualmin is as simple as installing a supported Operating System of your choice, followed by running Virtualmin's install.sh script.

A list of supported Operating Systems is provided at the OS Support page.

We recommend using a server version (or minimal version, with sshd if it is not part of the default install) of your Operating System. Virtualmin's install.sh script will install any additional packages that it requires.

Partitioning

We typically recommend putting everything on one partition, unless you have a good reason for doing otherwise. If everything is on one partition, and the partition uses the XFS filesystem, you'll need to reboot the system to enable quotas

If you wish to use multiple partitions, it's no problem to put /home and /var onto a separate partition. Virtualmin puts all user data, including websites and email, into /home. Database data and log files are stored in /var.

If you choose to use multiple partitions, we'd suggest devoting as much space as possible to /home.

Running the Install Script

Installation is performed automatically by the OS-neutral Virtualmin install.sh script. This script sets up the license key in /etc/virtualmin-license and configures the appropriate package management and installation tool for use with the password-protected Virtualmin software repository. It will then install the virtualmin-base package, which performs the remainder of the installation, appropriate for your OS and version.

Download the file from the Software Licenses page on your Account page, under the Software Licenses tab, if you're using Virtualmin Pro. All of your purchased products will be available for download throughout the life of your license period. If you're using Virtualmin GPL, that can be downloaded from the Download page.

With the install.sh script on your server, run this command as root:

# sh ./install.sh

The install.sh has a number of options that can be used to perform a particular type of installation. The usage (--help) output describes the available options:

--uninstall|-u - Removes all Virtualmin packages (do not use on a production system)
--help|-h - This message
--force|-f - Skip confirmation message
--hostname|-h - Set fully qualified hostname
--verbose|-v - Verbose
--setup|-s - Setup software repositories and exit (no installation or configuration)
--minimal|-m - Install a smaller subset of packages for low-memory/low-resource systems
--bundle|-b <name> - Choose bundle to install (LAMP or LEMP, defaults to LAMP)
For the most reliable, predictable, and well-tested configuration, use the default installation target. Minimal and LEMP modes are new in Virtualmin 6.0 and have had much less real world testing than the default.

LAMP vs. LEMP

The Virtualmin install script can setup Apache or nginx. The default, and best-tested and most feature-complete, is Apache. But, if you prefer nginx, you can install a bundle with the LEMP stack instead of the LAMP stack. Use the --bundle LEMP option for nginx.

Full Install vs. Minimal Install

The full LAMP or LEMP stack, plus a full mail processing stack including SpamAssassin and ClamAV, is quite large, requiring about 1GB minimum system memory in order to function well (and more is better). If you're using a lower memory system, it's not recommended, and maybe not even possible, to run the full mail stack along with LAMP or LEMP.

So, we provide an installation option, --minimal, that leaves off much of the mail processing stack. The installed components can still send and receive mail from local processes, but spam and AV scanning will need to be outsourced to a remote system (for example, a Cloudmin Services host), and several other ancillary packages will not be installed. The minimal installation type can probably operate OK with only 512MB of RAM (but more is still better).

If you want to locally host mail for end users (including IMAP/POP clients), the minimal installation target is probably not the right choice.

Questions install.sh might ask you

Depending on your OS and the state of your system, the install.sh script may ask one or more questions.

Fully qualified domain name

If your system does not have a fully qualified domain name (FQDN), the installer will stop and ask you to choose one. This is mandatory because many services rely on having a fully qualified domain name in order to function. Mail, in particular, but some Apache configurations and many of the Virtualmin-created configuration files, also require a valid fully qualified domain name to function correctly. A fully qualified domain name is one of the form "srv1.virtualmin.com", or simply "virtualmin.com" (but do not use a name you'll be hosting in Virtualmin). We recommend you choose a name that is not one for which you will be receiving mail, in order to simplify later configuration. A good choice is to use a name server designator, such as "ns1.virtualmin.com". Some customers also choose something like "host1.virtualmin.com" or "primary.virtualmin.com". Any of these would be valid and would satisfy the install script and the services that rely on this option. The install script will add this name to /etc/hosts, which will satisfy all local services. It is even better if this name resolves correctly when looked up from outside of the system--this requires the name be added to your DNS zone for the second level domain. If the Virtualmin server you are installing will be the authoritative name server for this zone, you can later use Webmin to add a record for this name to the zone.

Completing the installation

Once the necessary questions have been answered, installation will proceed automatically. After 2-20 minutes, depending on the speed of your network connection and hardware, your system will be configured for Virtualmin and ready to login to. You can then login to Virtualmin. Virtualmin runs on port 10000 and is encrypted using SSL. Thus, you can connect to your system with an address of the form:

https://example.com:10000

Or:

https://192.168.1.1:10000

And then log in as the "root" user, or any user with sudo access.

It will then walk you through a post-installation setup wizard, asking you a series of setup questions.

The final step in the installation is to perform the configuration check, by clicking the Check Configuration button at the top of the Virtualmin System Information page.

Setting a root password

If your system does not have a password set for the root user, you may need to set a Virtualmin root password before you can login on port 10000. This can be the case when installing on an EC2 instance that uses an SSH key to login as root, or an Ubuntu system that uses sudo. If you have an administrative user with sudo ALL privileges, you can use that user to login to Virtualmin.

To set a root password for Virtualmin, run the command :

/usr/{share,libexec}/webmin/changepass.pl /etc/webmin root XYZ

where XYZ is the password you want to use. Make sure it is strong, as an attacker who guesses this password would have full control over your system.