How to host multiple sites on one server
Updated 7/20/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 install phpMyAdmin to manage MySQL from the browser
Manage your MySQL databases from a web interface with phpMyAdmin, installed and secured correctly.
Updated 7/20/2026Web serversHow 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 7/20/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 7/20/2026