Multiple sites on one server
How to host a dozen sites on one VPS: directory layout, separate configs and users, a shared certificate, and estimating load by tier.
Updated August 23, 2026
A single public IPv4 address can serve any number of domains: the web server routes requests by the Host header. The limit isn't addresses — it's the memory and disk of your tier.
Layout
Keep one template, or in six months you won't be able to tell which site belongs to whom:
/var/www/example.ru/public
/var/www/example.ru/logs
/var/www/shop.ru/public
/var/www/shop.ru/logs
Keep a separate config file per site: /etc/nginx/sites-available/<domain>, enabled via a symlink in sites-enabled. Disabling a site then means deleting one symlink and reloading, instead of hunting for the right chunk in a shared file.
Configuration
server {
listen 80;
server_name example.ru www.example.ru;
root /var/www/example.ru/public;
index index.html index.php;
access_log /var/www/example.ru/logs/access.log;
}
Also set up a “catch-all site” for unknown domains, otherwise the first config alphabetically will open for any third-party domain pointed at your address:
server {
listen 80 default_server;
server_name _;
return 444;
}
Separating permissions
If the sites belong to different clients or different projects, don't give them a shared user: a hole in one script otherwise means access to all of them.
useradd -r -d /var/www/example.ru -s /usr/sbin/nologin site-example
chown -R site-example:www-data /var/www/example.ru
chmod 750 /var/www/example.ru
For PHP, create a separate FPM pool per site with its own user and listen — see PHP-FPM. Separate your databases too: users and grants.
Certificates
A single certbot run covers several domains at once:
certbot --nginx -d example.ru -d www.example.ru -d shop.ru -d www.shop.ru
Renewal is shared, one timer. Details — Let's Encrypt.
How many sites will fit
Count by memory, not by the number of domains. A static site costs almost nothing; a CMS site with a database costs hundreds of megabytes.
| Tier | Memory | Guideline |
|---|---|---|
| VDS-1 (2 GB) | 2 GB | 1–2 CMS sites or a dozen static ones |
| VDS-2 (4 GB) | 4 GB | 3–5 CMS sites |
| VDS-3 (8 GB) | 8 GB | 8–12 CMS sites |
Disk is finite too: 40 GB on VDS-1, 250 GB on VDS-6. You can only upgrade your plan, paying the difference for the remaining days of the paid period.
Common mistakes
| Symptom | Cause |
|---|---|
| All domains show the same site | server_name didn't match, so the first block handled the request |
| Logs from all sites in one file | access_log isn't set in the site block |
| One site took everything down | Shared PHP-FPM pool with no limits |
| Out of disk space | Logs and backups on the same disk — set up logrotate |
Before adding another site, check the memory graphs for the past week in the “Overview” of the panel at
/hosting/vds/m/<id>. If the peak is already at the ceiling, a new site will be the cause of crashes, not a consequence.