Skip to content
savemores

VPS & deployment

Run Multiple Websites on One Hostinger VPS with Nginx Server Blocks

Host multiple websites on one Hostinger VPS: an Nginx server block per domain, a local port per Node.js app, free HTTPS per site, and what each KVM fits.

By · 20+ years in tech

Published · 9 min read

The short answer

  • 01One Hostinger VPS can serve many domains: each points at the same IP, and Nginx routes requests by the domain name the browser sends.
  • 02Give every site its own Nginx server block and every app its own local port (3001, 3002 and so on), bound to 127.0.0.1.
  • 03KVM 1 (1 vCPU, 4 GB) comfortably runs many static sites plus 2 to 3 small Node.js or Python apps; KVM 2 (2 vCPU, 8 GB) fits 5 to 8 small apps and a shared database.
  • 04Run Certbot once per site so each domain has its own Let's Encrypt certificate with automatic renewal.
  • 05You do not need a separate IP per domain, because both Nginx and HTTPS use the requested hostname.

The mechanism in two sentences

All your domains resolve to the same server IP. Nginx listens on 80 and 443, reads which hostname the browser asked for, and passes the request to the matching site: a folder of files for a static site, or a local port for an app.

That is the whole model. One server block per site, one port per app, and Certbot adds HTTPS to each domain.

Capacity: plan by RAM, not by site count

Static sites cost almost nothing to serve. Apps and databases are what fill a server, and they fill it through memory. KVM 1 starts from $4.99/mo and KVM 2 from $6.99/mo on a 48-month term, before the coupon.

PlanComfortable 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 headroom to build on the server
KVM 4 and upBusy apps, several databases, or heavy build steps

Setup, from DNS to the first two sites

Start from a secured Ubuntu 24.04 server with UFW enabled. Point each domain's @ and www A records at the VPS first (DNS walkthrough), because Certbot can only issue a certificate once the domain resolves to your server.

  1. 1Install Nginx, allow it through UFW and remove the stock default site so the Nginx welcome page is not what visitors see.
  2. 2Create a folder for the static site and give it its own config file in sites-available.
  3. 3Start the Node.js app on its own port with PM2, listening on 127.0.0.1 only, and give it a proxy server block.
  4. 4Symlink both configs into sites-enabled, test with nginx -t, then reload.
  5. 5Run Certbot once for each domain and do a renewal dry run.
Install Nginx:
bash
sudo apt update && sudo apt install -y nginx
sudo ufw allow 'Nginx Full'
sudo rm /etc/nginx/sites-enabled/default
Static site files:
bash
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.html
/etc/nginx/sites-available/site-one.com
nginx
server {
    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;
    }
}
Node.js app on port 3001 (Next.js and most Node frameworks read PORT):
bash
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 prints
/etc/nginx/sites-available/site-two.com
nginx
server {
    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";
    }
}
Enable both sites:
bash
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 nginx
HTTPS for each domain:
bash
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-run

Why one certificate per site

Certbot reads your server blocks, fetches a Let's Encrypt certificate for each domain, writes the HTTPS settings and schedules renewal. Running it once per site rather than once for every domain together means each site owns its certificate, so removing one site later never disturbs the rest.

Adding site number three, and beyond

Every new site is the same routine:

  1. 1Point the domain's A records at the VPS.
  2. 2Create a folder (static) or start the app on a fresh port with PM2 (app).
  3. 3Copy an existing file in sites-available and change server_name and the root or port.
  4. 4Link it into sites-enabled, run nginx -t, then reload.
  5. 5Run Certbot for the new domain.

Verify it worked

Repeat this pass every time you add a site, not just the first time.

  • Each domain shows its own content, not another site's.
  • certbot renew --dry-run completed without errors.
  • After a reboot, pm2 ls shows the apps back online.
bash
sudo nginx -t                    # expect: syntax is ok / test is successful
pm2 ls                           # expect: site-two online
sudo ss -tlnp | grep 3001        # expect: 127.0.0.1:3001, not 0.0.0.0:3001
sudo certbot certificates        # expect: one certificate per site, with expiry dates
curl -I https://site-one.com     # expect: 200 over HTTPS
curl -I https://site-two.com     # expect: 200 over HTTPS, served by your app

Would a dashboard suit you better?

If editing config files is not how you want to spend evenings, Coolify runs on the same kind of VPS and handles domains, HTTPS, Git deploys and databases from a web UI. It uses more memory than plain Nginx, so treat it as a KVM 2-and-up option. Either way, GitHub Actions can deploy each site on push.

Questions people ask

How many websites can a Hostinger VPS host?

There is no fixed limit; resources set it. KVM 1 runs many static sites and a few small apps, and since apps and databases consume most of the RAM, plan capacity around those.

Can I mix WordPress, static sites and Node.js apps on one server?

Yes. Install PHP-FPM for WordPress or Laravel and give that site a server block that passes PHP requests to it; Nginx routes each domain to the right backend.

Does each domain need its own IP address?

No. Nginx and HTTPS both rely on the hostname the browser sends, so all your sites can share one IP.

Does WEBHOST2026 work on KVM plans?

Yes. WEBHOST2026 takes an extra 20% off eligible KVM plans, and the 24 and 48-month terms have the lowest monthly price.

Independent site, not Hostinger. Buy through my links and Hostinger pays me a referral fee; your price is the same or lower. How that works.