Host multiple websites on one Hostinger VPS (Nginx, step by step)
Run several domains, static sites and Node.js apps on a single VPS: one Nginx server block per site, a separate port per app, free HTTPS for every domain, and how many sites each KVM plan can carry.
How it works
Every domain points at the same server IP. Nginx listens on ports 80 and 443, reads the domain each browser asks for, and hands the request to the right site: a folder of files for a static site, or a local port for an app.
That's all there is to it. One server block per site, one port per app, and Certbot adds HTTPS to each domain.
How many sites fit?
Static sites barely use any resources. Apps are what fill a server, mostly through RAM.
| Plan | Comfortable load |
|---|---|
| KVM 1 (1 vCPU, 4 GB) | Many static sites plus 2–3 small Node.js or Python apps |
| KVM 2 (2 vCPU, 8 GB) | 5–8 small apps, a shared Postgres or MySQL, and room to build on the server |
| KVM 4 and up | Busy apps, several databases, or heavy build steps |
1. Point every domain at the server
For each domain, add an A record for `@` and `www` with your VPS IP address. Do this first, because Certbot can only issue a certificate once the domain resolves to your server.
2. Install Nginx
Start from a secured Ubuntu 24.04 server with UFW enabled.
sudo apt update && sudo apt install -y nginx
sudo ufw allow 'Nginx Full'
sudo rm /etc/nginx/sites-enabled/default3. Add a static site
Put the files in their own folder and give the site its own config file.
sudo mkdir -p /var/www/site-one.com/public
sudo chown -R $USER:$USER /var/www/site-one.com
echo '<h1>site-one.com works</h1>' > /var/www/site-one.com/public/index.htmlserver {
listen 80;
listen [::]:80;
server_name site-one.com www.site-one.com;
root /var/www/site-one.com/public;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}4. Add a Node.js app
Give each app its own port and keep it running with PM2. Apps should listen on `127.0.0.1` only, so the outside world can reach them only through Nginx.
sudo npm install -g pm2
cd ~/apps/site-two
npm ci && npm run build
PORT=3001 HOSTNAME=127.0.0.1 pm2 start npm --name site-two -- start
pm2 save && pm2 startup # run the command it printsserver {
listen 80;
listen [::]:80;
server_name site-two.com www.site-two.com;
location / {
proxy_pass http://127.0.0.1:3001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}5. Enable the sites
`nginx -t` checks every config file before the reload, so a typo in one site can't take the others down.
sudo ln -s /etc/nginx/sites-available/site-one.com /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/site-two.com /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx6. Free HTTPS for every domain
Certbot reads your server blocks, gets a Let's Encrypt certificate for each domain, adds the HTTPS settings and sets up automatic renewal.
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d site-one.com -d www.site-one.com
sudo certbot --nginx -d site-two.com -d www.site-two.com
sudo certbot renew --dry-runAdding the next site
Every new site follows the same steps:
- Point the domain's A records at the VPS.
- Create a folder (static) or start the app on a new port with PM2 (app).
- Copy an existing config file in sites-available, change server_name and root or the port.
- Link it into sites-enabled, run `nginx -t`, then reload.
- Run Certbot for the new domain.
Prefer a dashboard?
If you'd rather not edit config files, Coolify runs on the same VPS and does all of this through a web interface: domains, HTTPS, Git deploys and databases. It uses more memory than plain Nginx, so it suits KVM 2 and up.
Frequently asked questions
How many websites can I host on a Hostinger VPS?
There's no fixed limit; it depends on resources. KVM 1 handles many static sites and a few small apps. Apps and databases use most of the RAM, so plan by those.
Can I mix WordPress, static sites and Node.js apps?
Yes. Add PHP-FPM for WordPress or Laravel and give that site a server block that passes PHP to it. Nginx routes each domain to the right place.
Do I need a separate IP for each domain?
No. Nginx and HTTPS both use the domain name the browser sends, so every site can share one IP.
Does the WEBHOST2026 coupon work on the VPS?
Yes. The links on this site apply WEBHOST2026 to KVM plans, and the 24 and 48-month terms have the lowest monthly price.
Ready to save an extra 20% with coupon WEBHOST2026?
Get my discount link →Disclosure: links to Hostinger on this page are referral links. If you buy through them we may earn a commission, at no extra cost to you. It doesn't change what we recommend. About us
Keep reading
How to point a domain to your Hostinger VPS (A records, step by step)
Find your VPS IP, add the right A and AAAA records whether your domain is at Hostinger, GoDaddy or Namecheap, and check propagation before you ask Let's Encrypt for a certificate.
TutorialsSecure a new Hostinger VPS: the 10-minute checklist
SSH keys, no root or password logins, a firewall, Fail2ban, automatic security updates and snapshots. The minimum to do before a fresh VPS goes on the internet, with copy-paste commands.
TutorialsInstall Coolify on a Hostinger VPS: your own Vercel/Heroku for a flat price
Coolify gives you git push deploys, automatic HTTPS, databases and preview deploys on your own server. Install it on a Hostinger VPS, put the dashboard on your domain, deploy a first app and lock down the ports.