Multi-Site Server Management with Virtualmin: Isolation and Backups

Virtual server isolation, PHP-FPM pools, quotas and resource limits, backups and restore testing so one site in Virtualmin doesn’t take the others down.
Technical summary
Technology
Virtualmin, Webmin, PHP-FPM, Apache/Nginx, MariaDB, Let’s Encrypt
Topic
Isolation, resource and backup management on a multi-site Linux server
Level
Intermediate
Prerequisites
  • Basic Linux system administration knowledge
  • A server with Virtualmin installed
  • PHP-FPM and web server concepts
In this article7 sections

Twenty sites run on a single Linux server, and one of them has an old plugin vulnerability. On a correctly set up Virtualmin server, the damage stays in that site’s home directory; on a badly set up one, the attacker also gets access to the files of the other nineteen sites. Virtualmin is an open-source Webmin module that manages many websites, domains, databases and email accounts from a single panel. It’s easy to set up, but that ease also makes it easy for sites to become interdependent and fragile over time: one site’s traffic spike slows down the whole server, and backups are taken but never restored. Below we describe the setup we apply in the field for isolation, resource control, backups and panel security.

Virtualmin’s building blocks

To manage Virtualmin correctly, you need to know what the panel configures in the background. The panel isn’t a web server itself; it generates the configuration files of standard services such as Apache or Nginx, PHP-FPM, MariaDB/MySQL, BIND, Postfix and Dovecot on your behalf. When the panel fails, those files are what you’re left with.

Concept What it maps to in the background
Virtual server A Unix user and group, a home directory, a web server virtual host definition, and optionally a DNS zone, database and mail domain
Sub-server Under the same owner, a separate domain but the same Unix user
Alias A definition that points another domain to an existing site
Account plan and template Which features and default settings new virtual servers are created with

The decisive distinction for isolation is this: sub-servers run with the parent server’s Unix user. For sites belonging to the same customer or the same team, a sub-server can be practical. But sites that must be independent of each other (e.g. a corporate site and a separate campaign site, or two different departments’ applications) should always be created as separate top-level virtual servers. The structural mistake we see most often in the field is everything being added as sub-servers under a single virtual server “to be quick”.

The panel’s changes are written to standard files; you can edit these files by hand. But Virtualmin may regenerate these files on some setting changes, and the line you added by hand is lost. Document changes made by hand and, where possible, make them at template level. Check the consistency of the current configuration regularly from the command line:

virtualmin check-config
virtualmin list-domains --multiline | less
virtualmin validate-domains --all-domains --all-features

validate-domains checks whether each virtual server’s configuration (web, DNS, database, mail) is consistent with the state Virtualmin expects. It’s the shortest way to find changes that were made by hand and forgotten.

Isolation per virtual server

The basic security rule of a multi-site server: the compromise of one site must not spread to the others. This rule is achieved not with a single setting but with several layers:

  • File ownership: Each virtual server’s files belong to its own Unix user, and its home directory is closed to other users. If all sites’ files belong to the web server user (www-data, apache), isolation exists only on paper.
  • PHP running as the site user: A separate PHP-FPM pool is defined for each virtual server and runs as that site’s user. Malicious code on one site can only touch files that user can write.
  • Database users: Each site uses its own database user, and that user has rights only on its own database. The MariaDB root account isn’t used by applications.
  • Shared directories: Separate PHP’s session and temporary directories per virtual server so that other sites can’t read session and upload files in shared directories such as /tmp.

On a server you’ve taken over, listing home directory permissions and which user PHP processes run as is a good enough start for a quick isolation check:

ls -ld /home/*/
ps -eo user,cmd | grep '[p]hp-fpm: pool' | sort | uniq -c

If all pools run as the same user, the PHP execution mode hasn’t been switched to FPM per virtual server. There’s no isolation.

PHP-FPM pools and version management

Virtualmin lets you choose the PHP execution mode (FPM, FCGId, CGI) and PHP version per virtual server. If several PHP versions are installed on the server (packages such as php8.1-fpm and php8.3-fpm on Debian/Ubuntu), each site can use its own version. Pool files are in the relevant version’s pool.d directory, usually named after the virtual server’s ID number.

You can see and change the PHP version a directory uses from the command line:

virtualmin list-php-directories --domain example.com
virtualmin set-php-directory --domain example.com \
    --dir /home/example/public_html --version 8.3

Since a version change affects only one site, it’s a mechanism suited to a gradual transition; but changing the version on a production site without compatibility testing is risky. We described migration planning and compatibility scanning in detail in the PHP version migration article. Pool performance settings such as pm.max_children are the subject of the article on PHP-FPM and MariaDB performance problems; what you need to know here is that each pool must have its own upper limit.

Resource limits and quotas

The most common way one site affects the others is resource consumption: uncontrolled crawler traffic, a plugin stuck in an infinite loop, a full disk. In Virtualmin you can set limits at three levels:

  1. Disk quota: A quota per virtual server requires quota support (the usrquota, grpquota mount options) to be enabled on the file system. Without quotas, one site’s log or backup files can fill the whole disk.
  2. Process and memory limits: Virtualmin’s resource limits screen defines limits such as the number of processes the virtual server user can run and memory per process. These limits are particularly meaningful for jobs running via cron and SSH.
  3. PHP-FPM pool limit: For web traffic, the most effective limit is the pm.max_children value. The sum of these values across all pools, multiplied by memory consumption per process, must not exceed physical memory. If every pool is given a generous value, the server goes into swap under concurrent load and every site slows down together.

An example calculation: on a server with 8 GB of memory, assume 3 GB is set aside for the operating system, MariaDB and the web server, and the average PHP process uses 80 MB. The remaining roughly 5 GB (5,120 MB ÷ 80 MB ≈ 64) is enough, leaving room for memory fragmentation and sudden spikes, for about 60 concurrent PHP processes in total. Share this capacity among pools according to each site’s traffic and importance; the critical site gets a higher limit and low-traffic promotional sites a lower one. Measure the average process memory on your own server and update the calculation accordingly.

Backups and restore testing

Virtualmin’s built-in backup tool gathers web files, databases, mailboxes and Virtualmin configuration per virtual server into a single archive. Scheduled backups are defined from the panel; targets such as a local directory, an SSH/SFTP server and S3-compatible object storage are supported. The same operation can be done from the command line:

# Back up all virtual servers, each as a separate archive
virtualmin backup-domain --all-domains --all-features \
    --newformat --dest /backup/virtualmin/%Y-%m-%d --strftime

# Restore a single virtual server
virtualmin restore-domain --source /backup/virtualmin/2026-11-09/example.com.tar.gz \
    --domain example.com --all-features

A backup sitting on the server’s own disk isn’t a backup on its own. A disk failure, the server being compromised or ransomware takes the backup too. At least one copy should be off the server, preferably in an immutable store. The general framework for this principle is described in the 3-2-1-1-0 backup rule article.

The missing link is almost always restore testing. A backup isn’t a backup until it’s tested. A regular test includes these steps:

  • Virtualmin is installed on a separate test server (not the production server), and the backup of a selected virtual server is restored.
  • It’s checked that the site opens, the database connection works and the latest content is in the backup.
  • The restore time is noted and compared with the acceptable downtime.
  • The date, scope and result of the test are recorded.

Repeat this cycle at least every few months, and immediately when a significant change is made on the server (a version upgrade, a new backup target).

Panel access and update checklist

The Virtualmin panel has full rights over all sites on the server; access to the panel is a much greater risk than access to a single site’s admin panel. If the panel falls, the server falls. Webmin/Virtualmin runs on TCP port 10000 by default, and this port must not be left open to the internet. On the certificate side, Virtualmin’s Let’s Encrypt integration automates obtaining and renewing certificates per virtual server; we described validation methods and tracking renewal errors in the Let’s Encrypt certificate automation article.

Periodic checklist:

  • Is access to the panel port open in the firewall only to the management network or VPN?
  • Is two-factor authentication enabled on administrator accounts?
  • Are the panel permissions given to virtual server owners limited to what they need?
  • Has each independent site been created as a separate top-level virtual server?
  • Do all PHP pools run as the site user, and does each one have a pm.max_children limit set?
  • Are disk quotas enabled, and is a disk usage alert defined?
  • Do scheduled backups go off the server, and is the date of the last restore test known?
  • Are the operating system, Webmin/Virtualmin and PHP packages updated regularly? Is a configuration and system backup taken before updates?
  • Are unused virtual servers, old PHP versions and abandoned databases cleaned up?
  • Are every site’s logs included in rotation? For details, see the web server log management article.

The Virtualmin documentation is the reference for the full list of command-line tools and their parameters. If you want to design the isolation and backup setup of a multi-site server from scratch, or have a server you’ve taken over audited, we handle these checks together as part of Linux VPS, Virtualmin and hosting management.

Frequently asked questions

Should I create a sub-server or a separate virtual server?

Sub-servers run with the parent server’s Unix user; there’s no file-level isolation between them. For sites belonging to the same owner and managed together, a sub-server can be practical. Create sites that must be independent of each other as separate top-level virtual servers.

Can each site use a different PHP version in Virtualmin?

Yes. If several PHP-FPM versions are installed on the server, the version can be selected per virtual server or per directory. Note: each version’s extensions are installed separately, and the php command on the command line uses the default version; cron jobs may run with a different version.

Is a Virtualmin backup enough on its own?

A Virtualmin backup covers site files, databases and panel configuration. But if the backup sits on the same server, it’s lost along with it in a disk failure or an attack. Keep at least one copy off the server, preferably in an immutable store, and test restores regularly on a separate server.

Does changing the Webmin panel port improve security?

Changing the port reduces the noise from automated scans but doesn’t provide real protection. The real measures are limiting panel access in the firewall to the management network or a VPN, enabling two-factor authentication and keeping the panel up to date.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek Web

We build and maintain corporate websites, WordPress and CMS platforms, intranet and SharePoint portals, document management, and form and approval workflows, and keep them secure and up to date.

Knowledge Center

Other articles