• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

How to Host Multiple Websites on a Single Hong Kong VPS: Complete Guide 2026

April 15, 2026

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-nginx

Step 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 site

Step 3: Create Nginx virtual host configuration per site

nano /etc/nginx/sites-available/site1.com
server {
    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 nginx

Step 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-email

Certbot 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 aapanel

Step 2: Add each website through the panel

  1. Log in to aaPanel at your VPS IP on port 7800
  2. Navigate to Website → Add Site
  3. Enter domain name, select PHP version, create database (aaPanel creates the database automatically)
  4. Repeat for each additional domain
  5. Each site gets its own document root, PHP-FPM pool, database, and Nginx virtual host — created automatically

Step 3: Install SSL via aaPanel

  1. Website → click site name → SSL
  2. Let’s Encrypt → select domain(s) → Apply
  3. Enable Force HTTPS
  4. 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 RAMRecommended Max SitesTraffic Profile
1 GB2–3 sitesVery low traffic (<100 daily visits each)
2 GB5–8 sitesLow-medium traffic (<500 daily visits each)
4 GB10–15 sitesMedium traffic (<2,000 daily visits each)
8 GB20–30 sitesMedium 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 = 500

For 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.com

Configure 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 -20

Conclusion

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.

Leave a Reply

You must be logged in to post a comment.

Recent Posts

  • How to Speed Up Your Website for China: A Technical Optimization Guide 2026
  • Hong Kong VPS Windows Server: How to Set Up and Use a Windows VPS in Asia (2026)
  • How to Host Multiple Websites on a Single Hong Kong VPS: Complete Guide 2026
  • Hong Kong VPS for SEO: How Server Location Affects Your Google Rankings in Asia
  • Best Hong Kong VPS Providers in 2026: Compared by Speed, Routing, and Value

Recent Comments

  1. Best Hong Kong VPS Providers in 2026: Compared by Speed, Routing, and Value - Server.HK on How to Migrate Your Website to a Hong Kong VPS: Zero-Downtime Transfer Guide (2026)
  2. vibramycin injection on How to Choose the Right Hong Kong VPS Plan: A Buyer’s Guide for 2026
  3. allopurinol for gout on CN2 GIA vs BGP vs CN2 GT: What’s the Real Difference for China Connectivity?
  4. antibiotics online purchase on How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)
  5. linezolid cost oral on Top 5 Use Cases for a Hong Kong Dedicated Server in 2026

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot