How to host multiple sites on one server
Updated 10/16/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/16/2026Web serversHow to deploy a Laravel app to production
Deploy Laravel properly on a VPS: Nginx, PHP-FPM, permissions, optimizations and the queue worker.
Updated 10/16/2026Web serversHow to force HTTPS and redirect HTTP
After installing SSL, make sure every visitor uses HTTPS, with a permanent 301 redirect from HTTP.
Updated 10/16/2026