Skip to content
Extra 20% off HostingerWEBHOST2026Get my link →
DiscountOffer.Store
Tutorials

Host multiple websites on one Hostinger VPS (Nginx, step by step)

9 min read

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.

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 room to build on the server
KVM 4 and upBusy 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.

bash
sudo apt update && sudo apt install -y nginx
sudo ufw allow 'Nginx Full'
sudo rm /etc/nginx/sites-enabled/default

3. Add a static site

Put the files in their own folder and give the site its own config file.

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;
    }
}

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.

Start the 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";
    }
}

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.

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

6. 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.

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

Adding 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.

Extra 20% off with WEBHOST2026Claim 20% off →

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

Ready to claim your Hostinger discount?

Generate your personalised cart link with coupon WEBHOST2026 attached — it takes 20 seconds.