Back to blog
February 2, 2026Guides

How to Host Multiple Websites on One VPS Server

Learn how to host multiple websites on a single VPS server using virtual hosts. Complete guide to managing multiple domains, SSL certificates, and resource allocation.

How to Host Multiple Websites on One VPS Server

Hosting multiple websites on one VPS server is an efficient and cost-effective way to manage several projects. Using virtual hosts, you can serve different domains from the same server, each with its own configuration, SSL certificate, and document root. This guide shows you how to set up and manage multiple websites on your VPS.

Benefits of Hosting Multiple Sites

  • Cost savings: One server instead of multiple hosting accounts
  • Centralized management: All sites in one place
  • Resource sharing: Efficient use of server resources
  • Easy scaling: Add more sites without additional infrastructure
  • Unified backups: Backup all sites together
  • Better control: Full server access for all projects

Setting Up Virtual Hosts with Nginx

Create separate server blocks for each website:

bash
nano /etc/nginx/sites-available/example1.com

server {
    listen 80;
    server_name example1.com www.example1.com;
    root /var/www/example1.com;
    index index.html index.php;
    
    location / {
        try_files $uri $uri/ =404;
    }
}

ln -s /etc/nginx/sites-available/example1.com /etc/nginx/sites-enabled/
nginx -t
systemctl reload nginx

SSL Certificates for Multiple Domains

Set up SSL certificates for each domain using Certbot:

bash
apt install -y certbot python3-certbot-nginx
certbot --nginx -d example1.com -d www.example1.com
certbot --nginx -d example2.com -d www.example2.com

# Certificates auto-renew via cron:
certbot renew --dry-run

Resource Management

Monitor and limit resources per site:

  • Use PHP-FPM pools with different resource limits
  • Set up separate MySQL databases for each site
  • Monitor disk usage: df -h
  • Track memory usage: htop or free -m
  • Configure log rotation to prevent disk fill
  • Use monitoring tools to track per-site performance

Site Isolation

Ensure sites don't interfere with each other:

  • Separate document roots: /var/www/site1, /var/www/site2
  • Different PHP-FPM pools with resource limits
  • Separate database users and databases
  • Individual SSL certificates per domain
  • Isolated log files for each site
  • Use chroot or containers for maximum isolation (advanced)

Monitoring Multiple Sites

  • Set up uptime monitoring for each domain
  • Monitor disk space usage regularly
  • Track bandwidth usage per site
  • Set up alerts for high resource usage
  • Regular backups of all sites
  • Monitor SSL certificate expiration dates