A VPS has one IP address and can serve as many sites as its memory and processor can carry. The web server picks which one to show from the name in the request (server_name in nginx, ServerName in Apache). Each site needs three things: its domain pointing at the VPS IP, its own folder, and its own configuration block.
You do not need an IP per site, nor a VPS per site. What is shared is the machine: if one site eats everything, the others feel it. Think about that before putting a shop and a test blog side by side.
Step by step
| 1 |
One folder per site. For example /var/www/first.tld/public and /var/www/second.tld/public. Mixing sites in one folder lets a fault in one reach the other.
|
|
| 3 |
One A record per domain (and for www) with the VPS IP. If the domain is with us, it is in My MozOut; if it is elsewhere, it is there. See pointing a domain at your own VPS.
|
|
| 4 |
Test each one before DNS has spread. From your computer: curl -I --resolve first.tld:80:203.0.113.10 http://first.tld/ (swap the IP for your VPS’s). Does the right site answer? Then the configuration is right. Alternative: the hosts file.
|
|
| 5 |
One certificate per name. With certbot, sudo certbot --nginx -d first.tld -d www.first.tld, and the same for the second. Renewal is automatic for all of them, but test it: when the renewal fails.
|
|
| 6 |
One error log per site. When something breaks, knowing which site it came from saves an afternoon. In nginx, error_log /var/log/nginx/first.tld.error.log; inside the site’s block.
|
|
What happens to a name you did not configure
If anyone points some domain at your VPS’s IP, the server answers with the first site configured, or with the one marked as default. That shows your site under someone else’s name. To prevent it, mark one block as the default (in nginx, listen 80 default_server;) that returns nothing useful, and leave the real sites only on their own names.
| Shared |
Worth keeping apart |
| The VPS’s processor, memory and disk |
Each site’s folder, so one cannot read the other |
| The IP and ports 80 and 443 |
A database and a database user per site |
| The web server and PHP |
Each site’s logs, to know whose error is whose |
| The backup (which is yours) |
Certificates per name, not one for everything |
|
One compromised site compromises its neighbours. On a VPS with several sites under the same user, whoever gets in through an outdated WordPress reaches the other folders. If the sites belong to different customers, or matter very differently, use different system users per site (file permissions) or, better, different VPSs. See also keeping your VPS secure.
|
|
Want to know whether your VPS can carry one more site? Tell us the plan and what you plan to put on it, and we will help you read the numbers in the panel.
Open a support ticket
|
RECOMMENDED PRODUCT VPS server with root access Resources of your own, the OS you choose, reinstall whenever you like. from $8.40/mo (3-year plan, with coupon) See plans |