Hosting
Servers
Web Development Pricing
Resources
Get started → Log in
Home/Blog/Node.js hosting in India

Node.js hosting in India:
Node and Next.js on a VPS.

28 November 20269 min readBy the RapidServer team

Where can you host a Node.js app in India?

Host a Node.js or Next.js app in India on a Linux KVM VPS with full root, where the app runs as its own long-lived process. A RapidServer VPS starts at ₹581/mo plus 18% GST in Mumbai (BOM1) or Delhi NCR (DEL1), with a ready Node.js image (LTS and PM2). Deploy from git, run the app under PM2, put Nginx in front and add free HTTPS with Certbot.

Web hosting for Node.js: shared hosting or a VPS?

RapidServer web hosting is cPanel on LiteSpeed, set up for PHP sites such as WordPress and Laravel. For a Node.js API or a Next.js app, which runs as its own process and must stay up, a VPS is the reliable route:

  • Full root: install the Node.js version you want, Nginx and any database.
  • Always on: PM2 brings the app back after a crash or a reboot.
  • Dedicated vCPU on KVM and NVMe, so builds run on cores that stay yours.
  • Two cities, one price: a VPS in Mumbai or a VPS in Delhi; Noida and Gurugram are served from DEL1.

A Next.js static export is plain HTML, CSS and JavaScript that any web server can serve, but it drops the features that need a server.

Step 1: Node.js LTS and PM2

Order a VPS and pick the Node.js image, which comes with Node.js LTS and PM2, or plain Ubuntu 24.04 LTS. It is usually ready a few minutes after payment. Log in over SSH with the IP from the client area (SSH kya hai), and run your app as a normal user with sudo rather than root (securing SSH). On the Node.js image, check the versions:

shell
node -v
npm -v
pm2 -v

To install Node.js yourself, run the nvm commands from the Node.js download page as the app's user; copy them fresh, as versions change. Node.js says production apps should only use Active LTS or Maintenance LTS releases; the newest LTS line is 26 as we write. Then install PM2 (quick start):

install Node.js and PM2
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
\. "$HOME/.nvm/nvm.sh"
nvm install 26
node -v
npm install pm2@latest -g

Step 2: Deploy your app from git

Clone your repository on the server; for a private one, add the server's key to it as a read-only deploy key. Then install dependencies exactly as locked in package-lock.json:

deploy
git clone git@github.com:you/my-app.git ~/my-app
cd ~/my-app
npm ci

Have a plain Node.js app listen on process.env.PORT, such as 3000, on 127.0.0.1, so only Nginx can reach it.

Step 3: Environment variables and secrets

Keep API keys and passwords in a .env file on the server, never in git, and run chmod 600 .env.

  • Plain Node.js reads it with the --env-file flag, stable from v24.10.0 and v22.21.0. A variable already set in the environment wins over the file.
  • Next.js loads .env* files itself (environment variables guide), checking process.env first. Only NEXT_PUBLIC_ variables reach the browser, and they are inlined at next build, so change one and build again.

For plain Node.js, a PM2 ecosystem file passes the flag with node_args and holds non-secret values in env:

ecosystem.config.js
module.exports = {
  apps: [{
    name: "api",
    script: "./server.js",
    node_args: "--env-file=.env",
    env: {
      NODE_ENV: "production",
      PORT: "3000"
    }
  }]
}

Step 4: Keep it running with PM2 and start on boot

PM2 restarts your app if it crashes. Start it, check it, then set up startup on boot (PM2 startup guide):

pm2
pm2 start ecosystem.config.js
pm2 list
pm2 logs api
pm2 startup
pm2 save

Run pm2 startup without sudo: it prints one sudo command for your init system to copy and run. pm2 save stores the running apps so they return after a reboot; run it again when you add or remove one. After a Node.js upgrade, run pm2 unstartup, then pm2 startup again.

Next.js hosting: next build and next start

A VPS makes simple hosting for Next.js: the deploying guide says a Node.js server supports all Next.js features. Check package.json has these scripts:

package.json
"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start"
}

next start listens on port 3000 on every interface (0.0.0.0) by default, so pass -H 127.0.0.1 to keep it behind Nginx; with npm run, flags go after -- (next CLI). PM2 can start an npm script as a quoted command:

next.js
cd ~/my-app
npm ci
npm run build
pm2 start "npm run start -- -H 127.0.0.1" --name web
pm2 save

For another port, add -p 3001; PORT can't be set in .env. next/image optimization works with next start out of the box. For streaming, the self-hosting guide says to turn off Nginx buffering, for example with an X-Accel-Buffering: no header from next.config.js.

Nginx as a reverse proxy

Next.js recommends a reverse proxy such as Nginx in front of the app, which handles malformed requests and slow connections; do the same for any Node.js app. Run sudo apt install nginx, then create /etc/nginx/sites-available/example.com:

nginx server block
server {
    listen 80;
    server_name example.com www.example.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

The Upgrade lines let WebSockets through. Enable the site and reload:

shell
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Open only SSH, 80 and 443 (sudo ufw allow OpenSSH, sudo ufw allow 80,443/tcp, sudo ufw enable) and keep port 3000 closed. See our firewall guide.

Free HTTPS with Certbot

Point your domain's A record at the VPS's IPv4 address (DNS kya hai), then follow Certbot's Nginx instructions for Linux (snap): install it, get a free Let's Encrypt certificate that Certbot adds to Nginx, and test renewal:

certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/local/bin/certbot
sudo certbot --nginx
sudo certbot renew --dry-run

New to certificates? Read SSL certificate kya hai.

Shipping updates

Take a snapshot before a risky change, then pull, install, build and restart (for the plain Node.js app, restart api):

update
cd ~/my-app
git pull
npm ci
npm run build
pm2 restart web

After editing .env, restart the app so it reads the file again; a changed NEXT_PUBLIC_ value needs a new build. Every RapidServer VPS gets daily backups kept for 7 days, plus snapshots on demand (VPS backup guide).

Which VPS plan to pick for Node.js

UsePlanPer month
A small API, a bot or a staging copyStardust: 2 vCPU, 4 GB RAM, 20 GB NVMe₹581
A Next.js site, or a few Node.js apps on one serverNew Moon: 2 vCPU, 4 GB RAM, 40 GB NVMe₹674
A production app with PostgreSQL and RedisFull Moon: 4 vCPU, 8 GB RAM, 160 GB NVMe₹1,723

For cheap Node.js hosting in India, start on Stardust and move up when the graphs say so. Builds are CPU-heavy, so watch the CPU and memory graphs during next build; New Moon's extra NVMe leaves room for node_modules and build output. Every plan has dedicated vCPU and full root, is billed monthly plus 18% GST, and can be upgraded any time with the difference prorated. Pick Mumbai (BOM1) for western and southern India or Delhi NCR (DEL1) for the north (data centers). Support works 24/7 in English and Hindi; managed support adds ₹1,499/mo (managed vs unmanaged).

Host your Node.js app on a KVM VPS in India.

Dedicated vCPU, NVMe, full root and a ready Node.js image with LTS and PM2 in Mumbai or Delhi NCR, ready a few minutes after payment, from ₹581/mo.

See VPS plans

Questions

Which web hosting is right for Node.js?+
For a Node.js API or a Next.js app that runs as its own process, a VPS is the reliable route: full root, your choice of Node.js version, and PM2 to keep the app running. Our cPanel web hosting is set up for PHP sites such as WordPress and Laravel. See VPS for developers.
How much does Node.js hosting cost in India?+
A RapidServer VPS starts at ₹581/mo plus 18% GST for Stardust: 2 vCPU, 4 GB RAM and 20 GB NVMe, billed monthly with no yearly lock-in. Daily backups kept for 7 days are included, and your first VPS has a 7-day money-back guarantee.
Can I host a Next.js app on a VPS?+
Yes. Next.js says a Node.js server supports all its features. Run npm run build, start next start under PM2 on port 3000, and put Nginx in front with free HTTPS from Certbot.
Which Node.js version should I use in production?+
An LTS release: nodejs.org says production apps should only use Active LTS or Maintenance LTS releases. Our Node.js image comes with Node.js LTS and PM2, or you can install the version your app needs with nvm.
Do I need PM2, or can I use systemd?+
Either works. PM2 restarts a crashed app, shows logs and starts your apps on boot after pm2 startup and pm2 save. A systemd service does the same without extra software; our bot hosting guide shows both.
Node.js app ko VPS par kaise host karein?+
Ek Linux KVM VPS lijiye aur Node.js image chuniye (Node.js LTS aur PM2 ke saath), ya nvm se Node LTS install kijiye. Code git se clone kijiye, secrets .env mein rakhiye, app PM2 se chalaiye aur pm2 startup aur pm2 save chalaiye, taaki reboot ke baad app khud chalu ho. Phir Nginx aur Certbot se free HTTPS lagaiye. RapidServer par VPS ₹581/mo plus 18% GST se shuru hota hai aur payment ke kuch minute baad ready ho jata hai.

Run Node.js and Next.js on a VPS in India.

KVM VPS with dedicated vCPU, NVMe, full root and a ready Node.js image in Mumbai or Delhi NCR, billed monthly in rupees with a GST invoice.