How to host multiple sites on one server
Updated 10/23/2026
A single VPS can host dozens of sites. In Nginx, each site is a separate "server block", identified by its domain.
1. One directory per site
mkdir -p /var/www/site-a /var/www/site-b
2. One server block per domain
/etc/nginx/sites-available/site-a:
server {
listen 80;
server_name site-a.com www.site-a.com;
root /var/www/site-a;
index index.html;
}
Same for site-b, with its own server_name and root.
3. Enable them
ln -s /etc/nginx/sites-available/site-a /etc/nginx/sites-enabled/
ln -s /etc/nginx/sites-available/site-b /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
4. Point each domain
Both domains point to the same server IP. Nginx picks the right site by server_name. See How to point a domain to your VPS.
Money-saving tip
With hourly billing, one larger VPS hosting several sites often costs less than several separate small plans.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to optimize Nginx performance: gzip, cache and HTTP/2
Make your site faster with gzip compression, static file caching and HTTP/2, a few lines of config.
Updated 10/23/2026Web serversHow to deploy a Node.js app to production
Run a Node.js app reliably in production with PM2 and Nginx, with auto-restart and HTTPS.
Updated 10/23/2026Web serversHow to host a static site or a React/Vue app
Publish a static site or a React/Vue build on Nginx, with correct routing for single-page apps.
Updated 10/23/2026