One of the most significant advantages of a Hong Kong VPS over shared hosting is the ability to host multiple websites on a single server — each with its own domain, database, SSL certificate, and resource allocation — without paying for separate hosting accounts.
For SEO professionals managing site clusters, developers running multiple client sites, and businesses maintaining several web properties, this capability transforms the economics of hosting: instead of paying $5–15/month per site on shared hosting, you pay $10–25/month total for a VPS that hosts 5–15 sites simultaneously.
This guide covers two approaches: manual Nginx virtual host configuration for developers comfortable with the command line, and aaPanel’s web interface for those who prefer a control panel workflow.
Prerequisites
- A Hong Kong VPS running Ubuntu 22.04 LTS
- At least 2 GB RAM (4 GB recommended for 5+ sites with database backends)
- Multiple domain names, each with DNS A records pointing to your VPS IP
- Root or sudo SSH access
Approach A: Nginx Virtual Hosts (Manual Configuration)
Step 1: Install the base stack
apt update && apt upgrade -y
apt install -y nginx mysql-server php8.1-fpm php8.1-mysql php8.1-curl \
php8.1-gd php8.1-mbstring php8.1-xml php8.1-zip certbot python3-certbot-nginxStep 2: Create directory structure for each site
# Site 1
mkdir -p /var/www/site1.com/public
chown -R www-data:www-data /var/www/site1.com
chmod -R 755 /var/www/site1.com
# Site 2
mkdir -p /var/www/site2.com/public
chown -R www-data:www-data /var/www/site2.com
chmod -R 755 /var/www/site2.com
# Repeat for each additional siteStep 3: Create Nginx virtual host configuration per site
nano /etc/nginx/sites-available/site1.comserver {
listen 80;
server_name site1.com www.site1.com;
root /var/www/site1.com/public;
index index.php index.html;
# WordPress permalinks
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
# Logging per site
access_log /var/log/nginx/site1.com.access.log;
error_log /var/log/nginx/site1.com.error.log;
}# Enable the site
ln -s /etc/nginx/sites-available/site1.com /etc/nginx/sites-enabled/
# Repeat for site2.com, site3.com etc.
# Test configuration
nginx -t && systemctl reload nginxStep 4: Create isolated databases per site
mysql -u root -p-- Site 1 database
CREATE DATABASE site1_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'site1_user'@'localhost' IDENTIFIED BY 'strong_password_1';
GRANT ALL PRIVILEGES ON site1_db.* TO 'site1_user'@'localhost';
-- Site 2 database
CREATE DATABASE site2_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'site2_user'@'localhost' IDENTIFIED BY 'strong_password_2';
GRANT ALL PRIVILEGES ON site2_db.* TO 'site2_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;Database isolation is critical for security: if one site’s application is compromised, the attacker cannot access other sites’ databases because each uses a separate MySQL user with permissions limited to its own database.
Step 5: Install SSL certificates for all domains
# Install certificates for all domains in one command
certbot --nginx \
-d site1.com -d www.site1.com \
-d site2.com -d www.site2.com \
-d site3.com -d www.site3.com \
--email your@email.com \
--agree-tos \
--no-eff-emailCertbot automatically updates each site’s Nginx configuration with SSL directives and sets up automatic renewal for all certificates simultaneously.
Approach B: aaPanel Multi-Site Management (GUI)
aaPanel (宝塔 international edition) provides a web interface for managing multiple sites without direct command line interaction — preferred by those managing sites for clients or without deep Linux experience.
Step 1: Install aaPanel
wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && bash install.sh aapanelStep 2: Add each website through the panel
- Log in to aaPanel at your VPS IP on port 7800
- Navigate to Website → Add Site
- Enter domain name, select PHP version, create database (aaPanel creates the database automatically)
- Repeat for each additional domain
- Each site gets its own document root, PHP-FPM pool, database, and Nginx virtual host — created automatically
Step 3: Install SSL via aaPanel
- Website → click site name → SSL
- Let’s Encrypt → select domain(s) → Apply
- Enable Force HTTPS
- Repeat per site — aaPanel handles renewal automatically
Resource Allocation: How Many Sites Can One VPS Handle?
The limiting resource for multi-site hosting is almost always RAM — each site’s PHP-FPM process pool and MySQL connections consume memory. Rough guidelines:
| VPS RAM | Recommended Max Sites | Traffic Profile |
|---|---|---|
| 1 GB | 2–3 sites | Very low traffic (<100 daily visits each) |
| 2 GB | 5–8 sites | Low-medium traffic (<500 daily visits each) |
| 4 GB | 10–15 sites | Medium traffic (<2,000 daily visits each) |
| 8 GB | 20–30 sites | Medium traffic with Redis caching |
PHP-FPM pool optimisation for multiple sites
Each site should have its own PHP-FPM pool with appropriate worker limits. Edit each pool configuration:
nano /etc/php/8.1/fpm/pool.d/site1.conf[site1]
user = www-data
group = www-data
listen = /run/php/php8.1-fpm-site1.sock
; Dynamic process management
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 500For low-traffic sites, use pm = ondemand to start PHP workers only when requests arrive — this reduces idle memory consumption significantly when hosting many sites with intermittent traffic.
Security Isolation Between Sites
When hosting multiple sites for different clients or purposes, implement these isolation measures:
Separate system users per site
# Create a dedicated system user for each site
adduser --system --no-create-home --group site1user
adduser --system --no-create-home --group site2user
# Assign document root ownership
chown -R site1user:site1user /var/www/site1.com
chown -R site2user:site2user /var/www/site2.comConfigure each PHP-FPM pool to run as the site’s dedicated user — preventing one compromised site from reading or modifying another site’s files.
Separate PHP-FPM sockets per site
Using Unix sockets rather than TCP ports for PHP-FPM, with each site using its own socket, prevents cross-site PHP execution even if Nginx configuration errors occur.
Log separation
Per-site access and error logs (as configured in the Nginx virtual host above) make security incident investigation dramatically faster — you can immediately identify which site is generating errors or receiving attack traffic.
Monitoring Resource Usage Across Multiple Sites
# See PHP-FPM process memory usage per pool
ps aux | grep php-fpm
# MySQL connections per database user
mysql -u root -p -e "SELECT user, COUNT(*) as connections FROM information_schema.processlist GROUP BY user;"
# Disk usage per site
du -sh /var/www/*
# Nginx requests per virtual host (requires log parsing)
awk '{print $1}' /var/log/nginx/*.access.log | sort | uniq -c | sort -rn | head -20Conclusion
Hosting multiple websites on a single Hong Kong VPS is one of the highest-ROI infrastructure decisions available to developers, SEO professionals, and digital agencies. A $15–20/month VPS running 10 WordPress sites with isolated databases, individual SSL certificates, and per-site logging costs less than two shared hosting accounts — while delivering consistently better performance, full root control, and CN2 GIA routing for all sites simultaneously.
Scale your multi-site operation on Server.HK’s Hong Kong VPS plans — NVMe SSD for fast I/O across all sites, CN2 GIA routing for Chinese visitors to every domain, and KVM virtualisation for full software stack control.
Frequently Asked Questions
Can I host WordPress multisite on a Hong Kong VPS?
Yes. WordPress Multisite (network installation) runs on a Hong Kong VPS with standard configuration. It supports both subdomain and subdirectory network structures. For subdomain networks, configure wildcard DNS (*.yourdomain.com → VPS IP) and a wildcard SSL certificate via Certbot (certbot --nginx -d yourdomain.com -d *.yourdomain.com — requires DNS challenge rather than HTTP challenge for wildcard certificates).
How do I prevent one site from using all the server’s resources?
PHP-FPM’s pm.max_children setting limits the maximum PHP workers per site pool — preventing any single site from spawning unlimited processes. For MySQL, use per-user connection limits: GRANT ... WITH MAX_USER_CONNECTIONS 20;. For CPU and memory limits, aaPanel Pro includes per-site resource limiting, or use Linux cgroups for manual control.
Is it safe to host client websites on a shared VPS?
With proper isolation (separate system users per site, per-site PHP-FPM pools running as site-specific users, and database user isolation), a compromised site cannot access other sites’ files or data. For sensitive client data, consider whether a dedicated server or separate VPS per client is appropriate — the isolation of separate VPS instances is stronger than user-level isolation on a shared server.