Virtualmin Instalaation for Hosting Management
Virtualmin is a comprehensive web hosting control panel and management system built on top of Webmin, providing administrators with powerful tools for managing virtual servers, websites, email accounts, registros DNS, databases, and system resources. With support for Apache and Nginx web servers, comprehensive email configuration, automated copia de seguridads, reseller functionality, and detailed monitoreo capabilities, Virtualmin scales from single-server implementacións to large hosting operations. Esta guía cubre complete Virtualmin installation, configuration, and administration for production hosting environments.
Tabla de contenidos
- Introduction
- System Requirements
- Pre-Instalaation Preparation
- Virtualmin Instalaation
- Initial Setup and Configuration
- Virtual Server Management
- Web Server Configuration
- Email Configuration
- DNS Zone Management
- Database Administration
- [Backup and Restore](#copia de seguridad-and-restore)
- Domain Templates
- Reseller Management
- SSL Certificates
- Security and Access Control
- Troubleshooting
- Conclusion
Introducción
Virtualmin represents the next evolution of Webmin for hosting providers, offering specialized tools for managing virtual servers, domains, and email accounts. Built on proven technologies including Apache, Nginx, Postfix, Dovecot, and BIND DNS, Virtualmin provides administrators with a unified interface for managing all aspects of web hosting infrastructure. Its template-based domain creation system, integrated copia de seguridad mechanisms, and support for reseller hierarchies make it ideal for hosting providers of all sizes.
Requisitos del sistema
Virtualmin operates efficiently on modest hardware while supporting enterprise-scale implementacións:
- Ubuntu 18.04 LTS through 22.04 LTS
- Debian 9 through 12
- CentOS 7, AlmaLinux 8+, or Rocky Linux 8+
- Minimum 2 GB RAM (4 GB recommended for production)
- At least 50 GB free disk space
- Root or sudo access
- Clean server installation
- Port 10000 available (Virtualmin/Webmin)
- Port 20000 available (Virtualmin theme)
- Multiple ports for mail servicios (25, 110, 143, 587, 993, 995)
Verifica system requirements:
# Check OS version
cat /etc/os-release | head -5
# Verify available memory
free -h
# Check disk space
df -h /
# Confirm port availability
sudo netstat -tulpn | grep -E "10000|20000"
# Check system architecture
uname -m
Pre-Instalaation Preparation
System Update and Dependencies
# Update system packages
sudo apt update && sudo apt upgrade -y
# Install essential tools
sudo apt install curl wget git software-properties-common apt-transport-https -y
# Install development tools
sudo apt install build-essential python3-dev -y
# Set hostname
sudo hostnamectl set-hostname virtualmin.example.com
# Update hosts file
echo "127.0.0.1 virtualmin.example.com virtualmin" | sudo tee -a /etc/hosts
# Verify changes
hostname -f
Network Configuration
# Configure DNS resolution
sudo nano /etc/resolv.conf
# Add: nameserver 8.8.8.8
# Add: nameserver 8.8.4.4
# Or use systemd-resolved
sudo systemctl enable systemd-resolved
sudo systemctl start systemd-resolved
# Verify DNS
nslookup google.com
dig google.com
Firewall Configuration
# Enable firewall
sudo ufw enable
# Set default policies
sudo ufw default deny incoming
sudo ufw default allow outgoing
# Allow essential services
sudo ufw allow 22/tcp # SSH
sudo ufw allow 80/tcp # HTTP
sudo ufw allow 443/tcp # HTTPS
sudo ufw allow 10000/tcp # Virtualmin/Webmin
sudo ufw allow 25/tcp # SMTP
sudo ufw allow 110/tcp # POP3
sudo ufw allow 143/tcp # IMAP
sudo ufw allow 587/tcp # Submission
sudo ufw allow 993/tcp # IMAPS
sudo ufw allow 995/tcp # POP3S
sudo ufw allow 3306/tcp # MySQL
sudo ufw allow 53/tcp # DNS TCP
sudo ufw allow 53/udp # DNS UDP
# Verify firewall
sudo ufw status verbose
Removing Conflicting Services
# Stop and remove Apache if pre-installed
sudo systemctl stop apache2
sudo systemctl disable apache2
sudo apt remove apache2 apache2-utils -y
# Stop and remove Nginx if running
sudo systemctl stop nginx
sudo systemctl disable nginx
sudo apt remove nginx -y
# Stop Postfix if installed
sudo systemctl stop postfix
sudo systemctl disable postfix
sudo apt remove postfix -y
# Verify no conflicts
sudo netstat -tulpn | grep LISTEN
Virtualmin Instalaation
Descargaing Instalaation Script
# Download official Virtualmin installer
cd ~
wget https://software.virtualmin.com/gpl/scripts/install.sh
# Make executable
chmod +x install.sh
# Review installer (optional)
less install.sh
Running Instalaation
# Execute installer
sudo ./install.sh
# Installer will:
# 1. Check system compatibility
# 2. Download and install dependencies
# 3. Install Webmin and Virtualmin
# 4. Install Postfix mail server
# 5. Install Dovecot POP3/IMAP
# 6. Install Apache/Nginx
# 7. Install PHP
# 8. Install MySQL/MariaDB
# 9. Install ProFTPD
# 10. Install BIND DNS
# 11. Configure services
# 12. Generate SSL certificate
# Installation takes 30-45 minutes
# Monitor progress - do not interrupt
Post-Instalaation Verification
# Check Virtualmin service
sudo systemctl status webmin
# Verify required services running
for service in webmin mysql apache2 postfix dovecot bind9 proftpd; do
sudo systemctl status $service | grep -E "active|inactive"
done
# Check listening ports
sudo netstat -tulpn | grep -E "10000|25|110|143|3306"
# View installation summary
# Check /root/virtualmin-* files for credentials
# Test access
curl -k https://localhost:10000/
Initial Setup and Configuration
Accessing Virtualmin
# Access Virtualmin web interface
# URL: https://your-server-ip:10000
# or https://your-hostname:10000
# Default login
# Username: root
# Password: root system password (same as SSH)
# Accept self-signed certificate warning
Initial Configuration Wizard
Upon first access, Virtualmin provides setup wizard:
# Wizard steps:
# 1. System hostname verification
# 2. Network configuration
# 3. Email configuration
# 4. Database configuration
# 5. Web server selection
# 6. Backup configuration
# 7. Feature enablement
# Complete wizard:
# Click through each step
# Verify hostname matches
# Enable desired features
# Configure backup location
Changing Administrator Password
- Log in to Virtualmin
- Click username dropdown in top-right
- Select "Change Password"
- Enter current and new password
- Save changes
# Via Webmin interface:
# Settings > Change Password
# Or via command line (not recommended as Webmin manages passwords)
# Password stored in /etc/webmin/miniserv.users
Configuring Basic Settings
Navigate to Virtualmin > System Settings:
# General settings
# - Default servers (hostname)
# - Email for notifications
# - Backup settings
# - Feature selections
# Domain creation settings
# - Document root location
# - FTP/SFTP settings
# - Subdomain handling
# - Mail server configuration
# Defaults
# - Default PHP version
# - Default Apache modules
# - Default database type
Virtual Server Management
Creating Virtual Servers
A virtual server represents a hosted domain with its own configuration:
# Create new virtual server:
# Virtualmin > Create Virtual Server
# Fill form:
# - Domain name: example.com
# - Server description: Optional description
# - Username: System user for domain
# - Password: System user password
# - Group: System group
# - Email address: Contact email
# - Administrator name: Admin contact name
# - Automatically add mailbox: Yes
# - Automatically add subdomain: www
# - Enable SSL: Yes
# - Enable FTP/SFTP: Yes
# - Enable mail: Yes
# Server creation:
# - Creates Unix user/group
# - Allocates disk space
# - Configures web server
# - Sets up email
# - Creates database
# - Generates SSL certificate
Managing Virtual Servers
# View all virtual servers:
# Virtualmin > Virtual Servers
# Server operations:
# - Edit server settings
# - Delete server
# - View statistics
# - Manage subdomains
# - Configure FTP accounts
# - View logs
# Edit server:
# Virtualmin > Virtual Servers > Select server > Edit Server
# Delete server:
# Virtualmin > Virtual Servers > Select server > Delete
# Warning: Irreversible operation
# Monitor server:
# Virtualmin > Virtual Servers > Select server > Statistics
Adding Subdomains
# Add subdomain to virtual server:
# Virtualmin > Virtual Servers > Select domain > Create sub-server
# Fill form:
# - Subdomain: blog (creates blog.example.com)
# - Description: Blog subdomain
# - Create under parent's Unix user: Yes
# - Enable SSL: Yes
# - Enable mail: Optional
# - Enable FTP: Optional
# Subdomain uses parent domain's user account
# Simplifies permission management
Managing Virtual Server Users
# Create FTP/SFTP user:
# Virtualmin > Virtual Servers > Select domain > FTP and FTP Users > Create FTP User
# Fill form:
# - Username: ftpuser
# - Password: Strong password
# - Home directory: /home/domain/public_html
# - Enabled: Check
# User can upload files via FTP/SFTP
# Access: ftp://domain.com or sftp://domain.com
# Restrict to specific directory
Web Server Configuration
Apache Configuration
# Check Apache status
sudo systemctl status apache2
# Enable Apache modules
sudo a2enmod rewrite
sudo a2enmod ssl
sudo a2enmod proxy
sudo a2enmod actions
sudo a2enmod suexec
sudo a2enmod fcgid
# Restart Apache
sudo systemctl restart apache2
# Test configuration
sudo apache2ctl configtest
# View virtual host configuration
ls -la /etc/apache2/sites-available/
cat /etc/apache2/sites-available/example.com.conf
Nginx Configuration
# If Nginx was selected during installation
# Check Nginx status
sudo systemctl status nginx
# Verify Nginx configuration
sudo nginx -t
# View server block configuration
ls -la /etc/nginx/sites-available/
cat /etc/nginx/sites-available/example.com
# Reload Nginx
sudo systemctl reload nginx
PHP Configuration
# View installed PHP versions
php --version
ls -la /usr/bin/php*
# Set default PHP version
sudo update-alternatives --install /usr/bin/php php /usr/bin/php8.0 100
sudo update-alternatives --install /usr/bin/php php /usr/bin/php8.1 110
# Configure PHP per domain:
# Virtualmin > Virtual Servers > Select domain > Edit Server
# CGI Version: Select PHP version
# Edit PHP configuration
sudo nano /etc/php/8.0/apache2/php.ini
sudo nano /etc/php/8.0/fpm/php.ini
# Key settings:
# memory_limit = 256M
# upload_max_filesize = 100M
# post_max_size = 100M
# max_execution_time = 300
# Reload PHP/Apache
sudo systemctl reload apache2
Email Configuration
Postfix Mail Server
# Verify Postfix installation
sudo systemctl status postfix
# Check Postfix configuration
sudo postconf | head -20
# Main configuration file
sudo nano /etc/postfix/main.cf
# Key settings:
# myhostname = mail.example.com
# mydomain = example.com
# mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
# virtual_alias_domains = mysql:/etc/postfix/mysql-virtual-alias-domains.cf
# virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
# Reload Postfix
sudo systemctl reload postfix
Dovecot Configuration
# Verify Dovecot installation
sudo systemctl status dovecot
# Check Dovecot configuration
doveconf | head -20
# Configuration files
ls -la /etc/dovecot/
# Main configuration
sudo nano /etc/dovecot/dovecot.conf
# Key settings:
# protocols = imap pop3 lmtp
# mail_location = maildir:~/Maildir
# passdb = sql, pam
# userdb = sql, static
# Reload Dovecot
sudo systemctl reload dovecot
Creating Email Accounts
# Create email account:
# Virtualmin > Virtual Servers > Select domain > Edit Mail User > Add User
# Fill form:
# - Email address: [email protected]
# - Password: Strong password
# - Full name: User's full name
# - Mailbox: user
# - Enabled: Check
# - Mailbox size limit: Set quota (optional)
# Email configuration:
# IMAP: mail.example.com:993 (SSL) or :143 (STARTTLS)
# POP3: mail.example.com:995 (SSL) or :110 (no encryption)
# SMTP: mail.example.com:587 (STARTTLS)
# Username: [email protected]
# Password: [account password]
Email Forwarding
# Create email forward:
# Virtualmin > Virtual Servers > Select domain > Edit Mail Aliases
# Add alias:
# - Alias name: [email protected]
# - Forward to: [email protected]
# Forward to multiple addresses:
# - Alias name: [email protected]
# - Forward to: [email protected], [email protected]
# Catch-all forwarding:
# - Alias name: @domain.com
# - Forward to: [email protected]
DNS Zone Management
BIND DNS Server
# Verify BIND installation
sudo systemctl status bind9
# Check BIND configuration
sudo named -v
sudo named-checkconf
# DNS zones directory
ls -la /etc/bind/
# ISC BIND configuration
sudo nano /etc/bind/named.conf
Creating DNS Zones
# Virtualmin creates DNS zones automatically:
# When creating virtual server with DNS enabled
# Zone is created at: /etc/bind/zones/db.example.com
# Verify zone creation
ls -la /etc/bind/zones/
# Check zone syntax
named-checkzone example.com /etc/bind/zones/db.example.com
# Reload BIND after changes
sudo systemctl reload bind9
Managing DNS Records
# Add DNS record:
# Virtualmin > Virtual Servers > Select domain > Edit DNS Records
# Supported record types:
# - A: IPv4 address
# - AAAA: IPv6 address
# - CNAME: Canonical name/alias
# - MX: Mail exchange
# - TXT: Text record (SPF, DKIM, DMARC)
# - NS: Nameserver
# - SRV: Service record
# - SOA: Start of authority
# Example DNS records:
# A: example.com -> 192.168.1.100
# A: www -> 192.168.1.100
# CNAME: mail -> example.com
# MX: @ -> mail.example.com (priority 10)
# TXT: @ -> v=spf1 mx -all
Using Custom Nameservers
# Configure custom DNS:
# Virtualmin > System Settings > DNS
# Setup secondary DNS:
# - Install second server with Virtualmin
# - Configure as DNS slave
# - Zones automatically replicate
# Test DNS resolution
nslookup example.com
dig example.com
host example.com
# Check specific nameserver
dig @ns1.example.com example.com
Database Administration
MySQL/MariaDB Management
# Verify MySQL installation
sudo systemctl status mysql
# Check MySQL version
mysql --version
# Access MySQL
mysql -u root -p
# Create database for domain:
# Virtualmin > Virtual Servers > Select domain > Edit Database
# Or via command line
mysql -u root -p << 'EOF'
CREATE DATABASE example_com;
CREATE USER 'example_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON example_com.* TO 'example_user'@'localhost';
FLUSH PRIVILEGES;
EOF
# Verify database
mysql -u root -p -e "SHOW DATABASES;"
Remote Database Access
# Allow remote access to database:
# By default, MySQL only accepts localhost
# Edit MySQL configuration
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
# Change bind-address
# bind-address = 0.0.0.0
# Create remote user
mysql -u root -p
CREATE USER 'app_user'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON appdb.* TO 'app_user'@'%';
FLUSH PRIVILEGES;
EXIT;
# Restart MySQL
sudo systemctl restart mysql
Backup and Restore
Configuring Backups
# Configure backup settings:
# Virtualmin > System Settings > Backup and Restore
# Set:
# - Backup destination: /backup or remote
# - Backup format: tar.gz
# - Backup schedule: Daily/Weekly
# - Backup time: Off-peak hours
# - Backup retention: Number of versions
# - Include/exclude options
# Enable domain backups:
# Virtualmin > Virtual Servers > Select domain > Edit Server
# Enable: "Include in automatic backups"
Creating Manual Backups
# Trigger manual backup:
# Virtualmin > System Settings > Backup and Restore > Backup Now
# Or via command line
sudo /usr/libexec/webmin/virtual-server/backup-virtual.pl \
--domain example.com \
--backup /backup/
# Monitor backup progress
sudo tail -f /var/log/virtualmin-backup.log
# Verify backup
ls -lah /backup/
du -sh /backup/*
Restoring from Backup
# Restore virtual server:
# Virtualmin > System Settings > Backup and Restore > Restore
# Select:
# - Backup file to restore
# - Restore mode (new domain, overwrite, migrate)
# - Options to restore
# Restore includes:
# - Files and directories
# - Email accounts
# - Databases
# - SSL certificates
# - Configuration
# Verify restoration
# Check website loads
# Verify email accounts work
# Test database connectivity
Domain Templates
Using Pre-built Templates
# Virtualmin includes domain templates:
# Access templates:
# Virtualmin > Server Templates
# Available templates:
# - Default template
# - Web disabled template
# - Mail disabled template
# - FTP disabled template
# Create domain from template:
# Virtualmin > Create Virtual Server
# Choose template before creating
Creating Custom Templates
# Create new template:
# Virtualmin > Server Templates > Create Template
# Configure:
# - Template name
# - Description
# - Features to enable/disable
# - Default settings
# - Resource limits
# - Mail configuration
# Use custom template:
# Virtualmin > Create Virtual Server
# Select custom template
# Domain inherits template settings
Reseller Management
Creating Reseller Accounts
# Create reseller:
# Virtualmin > Manage Resellers > Create Reseller
# Fill form:
# - Username: reseller login
# - Password: Strong password
# - Full name: Reseller name
# - Email: Contact email
# - Account limits: Set quotas
# - Allowed features: Select capabilities
# - Can create subresellers: Yes/No
# Reseller access:
# URL: https://server-ip:10000
# Username: reseller username
# Password: reseller password
Reseller Capabilities
# Reseller can:
# - Create virtual servers (within limits)
# - Manage domains they created
# - Create mail accounts for their domains
# - Manage DNS zones
# - Access own backups
# - View resource usage
# Restrictions:
# - Cannot access other resellers' domains
# - Limited to quota limits
# - Cannot modify system settings
# - Cannot access other user accounts
SSL Certificates
Let's Encrypt Automatic SSL
# Enable Let's Encrypt:
# Virtualmin > System Settings > Server Components
# Enable: "Let's Encrypt SSL Certificate"
# Auto-install certificates:
# Virtualmin > Create Virtual Server
# Check: "Use Let's Encrypt SSL"
# Manual installation:
# Virtualmin > Virtual Servers > Select domain > Edit Server > SSL Certificate
# Click: "Request Let's Encrypt Certificate"
# Automatic renewal:
# Virtualmin configures renewal
# Renewal happens 60 days before expiration
# Automatic redeploy to web server
Using Custom Certificates
# Upload custom certificate:
# Virtualmin > Virtual Servers > Select domain > SSL Certificate
# Paste or upload:
# - Private key
# - Certificate (.crt)
# - Chain/intermediate certificates
# Configure certificate:
# Virtualmin tests certificate validity
# Configures web server
# Enables HTTPS access
Certificate Management
# View certificate details:
# Virtualmin > Virtual Servers > Select domain > SSL Certificate
# Shows: Expiration date, issuer, validation status
# Force renewal:
# Click: "Request New Let's Encrypt Certificate"
# Install certificate on all domains:
# Virtualmin > System Settings > SSL Certificates
# "Install matching Let's Encrypt certificates"
Security and Access Control
Firewall Configuration
# Enable UFW firewall (if not already done)
sudo ufw enable
# Restrict Virtualmin access
sudo ufw allow from 192.168.1.0/24 to any port 10000
# Or restrict to specific IP
sudo ufw allow from 203.0.113.100 to any port 10000
# Monitor firewall rules
sudo ufw status numbered
User Access Control
# Create Virtualmin administrator:
# Webmin > Users and Groups > Create User
# Set:
# - Username: admin username
# - Password: Strong password
# - Real name: Full name
# - Modules: Select Virtualmin modules
# Create restricted user:
# Assign only specific modules
# Prevent system settings access
# Limit to specific virtual servers
Audit Logging
# Enable audit logging:
# Webmin > Settings > Webmin > Logging
# Configure:
# - Log authentication attempts
# - Log configuration changes
# - Log API calls
# - Set log retention
# View logs:
# Webmin > Webmin > Log files
# Or access directly:
sudo tail -f /var/webmin/miniserv.log
Solución de problemas
Common Issues
# Virtualmin not accessible
sudo systemctl restart webmin
sudo systemctl status webmin
# Check port
sudo netstat -tulpn | grep 10000
# Website not displaying
# Verify virtual server created: Virtualmin > Virtual Servers
# Check Apache/Nginx: sudo systemctl status apache2
# View access logs: tail -f /var/log/apache2/domains/example.com.log
# Email not working
# Verify mail accounts: Virtualmin > Mail Users
# Check Postfix: sudo systemctl status postfix
# Check Dovecot: sudo systemctl status dovecot
# View mail logs: tail -f /var/log/mail.log
# DNS issues
# Check BIND: sudo systemctl status bind9
# Verify zone: named-checkzone example.com /etc/bind/zones/db.example.com
# Test DNS: dig example.com
Optimización del rendimiento
# Monitor resource usage
top -b -n 1 | head -20
# Check MySQL performance
mysql -u root -p -e "SHOW PROCESSLIST;"
# Optimize database
mysql -u root -p << 'EOF'
OPTIMIZE TABLE mysql.user;
OPTIMIZE TABLE information_schema.schemata;
EOF
# Monitor disk usage
df -h
du -sh /home/*
# Check web server processes
ps aux | grep apache2
ps aux | grep nginx
Conclusión
Virtualmin provides a comprehensive hosting control panel solution for administrators managing multiple websites, email accounts, and DNS zones. Built on proven technologies with strong integration and automation capabilities, Virtualmin scales efficiently from small hosting operations to large-scale implementacións.
By implementing the installation procedures, configuration practices, and seguridad measures outlined in this guide, you establish a reliable, professional hosting platform. Regular copia de seguridads, seguridad monitoreo, and rendimiento optimization ensure consistent servicio delivery.
Whether operating as a hosting provider or managing internal infrastructure, Virtualmin's feature-rich interface and automation capabilities make it an excellent choice for professional web hosting management.


