Running a web agency means juggling dozens, sometimes hundreds, of client websites. Each one has different requirements, different traffic patterns, and a different tolerance for downtime. The hosting architecture you choose is not just a technical decision; it directly impacts your profit margins, your support burden, and your agency's reputation. When a client's website goes down at 2 AM, it is your phone that rings.
Most agencies start on shared hosting or reseller plans, and that works fine for the first 10-20 sites. But as your client roster grows, you start hitting the limits: noisy neighbor problems where one client's traffic spike slows down everyone else, inflexible resource allocation, lack of root access for custom configurations, and the inability to offer premium hosting tiers to clients who need more. A VPS gives you the control, performance, and isolation to build a hosting practice that scales with your agency.
Architecture Decisions: Single VPS vs. Multiple VPS
The first question every agency faces is whether to consolidate all client sites on one large VPS or distribute them across multiple smaller instances. Both approaches have merits, and most successful agencies use a hybrid model.
The Consolidated Approach
Running 20-50 small to medium WordPress sites on a single well-configured VPS is efficient and cost-effective. You manage one server, one set of security updates, one backup schedule, and one monitoring configuration. A VPS with 8 vCPUs, 16 GB of RAM, and 320 GB of NVMe storage can comfortably serve 30-40 WordPress sites that each receive a few hundred daily visitors.
The consolidated approach works best when:
- Most client sites are similar in technology (all WordPress, all PHP-based)
- Traffic levels are moderate and predictable across clients
- You want to minimize management overhead
- Clients are on similar hosting tiers with comparable SLAs
The Distributed Approach
Separating clients onto individual VPS instances provides stronger isolation. If one client's site gets hacked or experiences a traffic explosion, it cannot affect other clients. This approach also lets you offer tiered hosting packages where premium clients get dedicated resources.
The distributed approach works best when:
- Clients have varying resource requirements (some run e-commerce, some run simple brochure sites)
- You need to bill clients individually based on actual resource usage
- Client contracts require dedicated infrastructure for compliance reasons
- You offer different SLA tiers (standard vs. premium)
The Hybrid Model (Recommended)
The most practical approach for agencies is a tiered model:
| Tier | Infrastructure | Client Type | Sites per VPS |
|---|---|---|---|
| Standard | Shared VPS (8 GB RAM) | Brochure sites, small blogs | 20-40 |
| Professional | Shared VPS (16 GB RAM) | Active blogs, small e-commerce | 10-15 |
| Premium | Dedicated VPS per client | High-traffic, e-commerce, SaaS | 1 |
| Enterprise | Managed Cloud Server | Mission-critical, compliance-required | 1 |
This model lets you price hosting appropriately for each client while keeping your infrastructure costs predictable. Standard tier clients share resources efficiently, while premium clients get guaranteed performance and isolation.
Server Configuration for Multi-Site Hosting
Web Server Setup with Nginx
Nginx is the preferred web server for agency multi-site hosting because of its efficient handling of concurrent connections and low per-connection memory footprint. Each client site gets its own virtual host configuration:
# /etc/nginx/sites-available/client-acme.conf
server {
listen 443 ssl http2;
server_name acme-corp.com www.acme-corp.com;
ssl_certificate /etc/letsencrypt/live/acme-corp.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/acme-corp.com/privkey.pem;
root /var/www/clients/acme-corp/public;
index index.php index.html;
# Client-specific access log
access_log /var/log/nginx/acme-corp.access.log;
error_log /var/log/nginx/acme-corp.error.log;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# WordPress configuration
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.3-fpm-acme.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Block access to sensitive files
location ~ /\.(ht|git|svn) { deny all; }
location ~ /wp-config\.php { deny all; }
}
PHP-FPM Pool Isolation
The most important isolation mechanism for shared VPS hosting is running separate PHP-FPM pools for each client. This ensures that one client's PHP processes cannot access another client's files, and a runaway script from one site cannot consume all server resources:
# /etc/php/8.3/fpm/pool.d/acme-corp.conf
[acme-corp]
user = acme
group = acme
listen = /run/php/php8.3-fpm-acme.sock
listen.owner = www-data
listen.group = www-data
pm = ondemand # Saves memory for low-traffic sites
pm.max_children = 8 # Limit per client
pm.process_idle_timeout = 30s
pm.max_requests = 500
# Resource limits per client
php_admin_value[memory_limit] = 256M
php_admin_value[max_execution_time] = 60
php_admin_value[upload_max_filesize] = 64M
php_admin_value[post_max_size] = 64M
# Security: restrict to client directory
php_admin_value[open_basedir] = /var/www/clients/acme-corp/:/tmp/
php_admin_value[disable_functions] = exec,passthru,shell_exec,system,proc_open
Using pm = ondemand is the key setting for agency servers. Unlike pm = static or pm = dynamic, ondemand only spawns PHP workers when requests come in and kills idle workers after the timeout. For a server hosting 30 sites where only 5-10 are receiving traffic at any given moment, this dramatically reduces memory usage.
Database Isolation
Each client should have their own MySQL database and database user with permissions restricted to only that database:
# Create isolated database for each client
CREATE DATABASE acme_corp CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'acme_db'@'localhost' IDENTIFIED BY 'strong-random-password';
GRANT ALL PRIVILEGES ON acme_corp.* TO 'acme_db'@'localhost';
FLUSH PRIVILEGES;
Never use a shared database user across clients. If one site is compromised, the attacker should not be able to access other clients' data.
Automation and Management at Scale
Managing 30+ sites manually is unsustainable. Agencies need automation for routine tasks.
Automated Site Provisioning
Create a provisioning script that handles the full setup for a new client site:
#!/bin/bash
# provision-client.sh - Automated client site setup
CLIENT=$1
DOMAIN=$2
# Create system user
useradd -m -d /var/www/clients/$CLIENT -s /bin/false $CLIENT
# Create directory structure
mkdir -p /var/www/clients/$CLIENT/{public,logs,backups}
chown -R $CLIENT:$CLIENT /var/www/clients/$CLIENT
# Create PHP-FPM pool from template
sed "s/{{CLIENT}}/$CLIENT/g; s/{{DOMAIN}}/$DOMAIN/g" \
/etc/templates/php-fpm-pool.conf > /etc/php/8.3/fpm/pool.d/$CLIENT.conf
# Create Nginx virtual host from template
sed "s/{{CLIENT}}/$CLIENT/g; s/{{DOMAIN}}/$DOMAIN/g" \
/etc/templates/nginx-vhost.conf > /etc/nginx/sites-available/$CLIENT.conf
ln -s /etc/nginx/sites-available/$CLIENT.conf /etc/nginx/sites-enabled/
# Create MySQL database
mysql -e "CREATE DATABASE ${CLIENT}_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
DB_PASS=$(openssl rand -base64 24)
mysql -e "CREATE USER '${CLIENT}_db'@'localhost' IDENTIFIED BY '$DB_PASS';"
mysql -e "GRANT ALL PRIVILEGES ON ${CLIENT}_db.* TO '${CLIENT}_db'@'localhost';"
# Obtain SSL certificate
certbot certonly --nginx -d $DOMAIN -d www.$DOMAIN --non-interactive --agree-tos
# Reload services
systemctl reload php8.3-fpm
systemctl reload nginx
echo "Site provisioned: $DOMAIN"
echo "DB User: ${CLIENT}_db | DB Pass: $DB_PASS"
Centralized Backup Strategy
Backups are non-negotiable for agency hosting. Implement a layered backup approach:
- Daily database backups: Automated mysqldump for each client database, retained for 30 days
- Daily file backups: Incremental backups of each client's web root using rsync or borgbackup
- Weekly full server snapshots: VPS-level snapshots for disaster recovery
- Off-site replication: Copy backups to a separate server or object storage in a different data center
# /etc/cron.d/client-backups
# Daily database backups at 2 AM
0 2 * * * root /opt/scripts/backup-all-databases.sh
# Daily file backups at 3 AM
0 3 * * * root /opt/scripts/backup-all-sites.sh
# Weekly cleanup of old backups
0 4 * * 0 root /opt/scripts/cleanup-old-backups.sh 30
Security at the Agency Level
When you host multiple client sites, a security breach on one site can potentially compromise your entire server if isolation is not properly implemented.
Essential Security Measures
- Separate Linux users per client: Each client runs under their own system user. PHP-FPM pools run as that user. File permissions prevent cross-client access.
- open_basedir restrictions: PHP can only access files within the client's directory. This prevents a compromised WordPress plugin from reading other clients' wp-config.php files.
- disable_functions: Block dangerous PHP functions (exec, shell_exec, system) for client pools. If a specific client needs command-line access for a legitimate plugin, enable it only for their pool.
- Fail2ban: Protect SSH and WordPress login pages from brute-force attacks across all hosted sites.
- ModSecurity WAF: Apply the OWASP Core Rule Set to block common attack patterns (SQL injection, XSS, file inclusion) at the web server level.
- Automated WordPress updates: Use WP-CLI to apply security updates across all client WordPress installations in a single operation.
# Update all WordPress cores on the server
for site in /var/www/clients/*/public; do
client=$(basename $(dirname $site))
sudo -u $client wp core update --path=$site 2>/dev/null
sudo -u $client wp plugin update --all --path=$site 2>/dev/null
done
Monitoring Multiple Client Sites
With dozens of sites on your server, you need visibility into which clients are consuming the most resources and whether any sites are experiencing issues.
Per-Client Resource Tracking
Monitor PHP-FPM pool status for each client to identify resource-heavy sites:
# Enable PHP-FPM status page per pool
pm.status_path = /fpm-status-$CLIENT
# Nginx location for status monitoring (restrict to localhost)
location ~ ^/fpm-status- {
allow 127.0.0.1;
deny all;
fastcgi_pass unix:/run/php/php8.3-fpm-$CLIENT.sock;
include fastcgi_params;
}
Set up external uptime monitoring for every client site. A simple HTTP check every 60 seconds catches outages before clients notice them. Track response times to identify performance degradation trends.
Pricing Hosting as a Service
One of the biggest advantages of VPS-based hosting for agencies is the ability to build hosting into a recurring revenue stream. Here is a practical pricing framework:
| Tier | Your Cost (approx.) | Client Price | Includes |
|---|---|---|---|
| Basic | $2-5/site/mo | $29-49/mo | Hosting, SSL, daily backups, uptime monitoring |
| Professional | $5-15/site/mo | $79-149/mo | Basic + performance optimization, staging, priority support |
| Premium | $15-40/site/mo | $199-399/mo | Professional + dedicated resources, WAF, CDN, monthly reports |
With Cloud VPS plans starting at $1.99/month, even a basic hosting tier provides healthy margins while delivering significantly better performance than what clients would get on shared hosting elsewhere. The key is bundling hosting with value-added services: security monitoring, performance optimization, uptime guarantees, and responsive support.
Scaling Your Agency Infrastructure
As your client base grows, your infrastructure needs to grow with it. Here is a typical scaling path:
10-30 Sites: Single VPS
A single VPS with 4-8 vCPUs, 8-16 GB of RAM, and 160-320 GB of NVMe storage handles this comfortably. All sites share one server, one backup system, one monitoring setup. Your management overhead is minimal.
30-100 Sites: Multiple VPS Instances
Split sites across 2-4 VPS instances by tier or by client type. Keep a dedicated "staging" VPS for development work. Consider a separate VPS for database hosting if several sites are database-intensive.
100+ Sites: Managed Infrastructure
At this scale, server management becomes a significant operational burden. Security patches, performance tuning, incident response, and capacity planning consume hours every week. This is where managed cloud servers become valuable. You get HA infrastructure with Proxmox clustering and Ceph distributed storage, 24/7 monitoring and incident response from a human support team, and the peace of mind that comes with a 100% uptime SLA. This frees your agency to focus on what generates revenue: building great websites for clients rather than fighting server fires.
Choosing Data Centers for Client Sites
If your clients are geographically concentrated, choose the nearest data center. For agencies serving clients across multiple regions, you can deploy VPS instances in different locations. With data centers in New York, London, Frankfurt, and Singapore, you can serve clients worldwide while keeping latency low for their target audiences.
For European clients with GDPR requirements, Frankfurt hosting provides EU data residency. For Asia-Pacific clients, Singapore offers excellent regional connectivity. The ability to host different clients in different regions without switching providers simplifies your operations considerably.
Client Onboarding Checklist
Use this checklist every time you onboard a new client site to your VPS:
- Create system user and directory structure
- Set up PHP-FPM pool with resource limits and security restrictions
- Create Nginx virtual host with proper security headers
- Create isolated MySQL database and user
- Obtain and configure SSL certificate
- Configure daily automated backups (database + files)
- Set up external uptime monitoring
- Test site performance baseline (load time, TTFB)
- Configure log rotation for client-specific logs
- Document DNS settings and credentials securely
Conclusion
Building an agency hosting practice on VPS infrastructure gives you the control, performance, and profit margins that shared hosting and generic managed platforms cannot match. Start with a hybrid tiered approach, invest in automation for provisioning and maintenance, implement strong per-client isolation from day one, and scale from single VPS to managed infrastructure as your client base grows. The result is a hosting operation that generates predictable recurring revenue while delivering noticeably better performance to your clients.