Guide10 min read

Run Node.js Apps on Hostinger VPS: Complete Deployment Guide

Deploying Node.js on Hostinger VPS takes about 20 minutes: install Node.js 20 LTS via NodeSource, deploy your application, set up PM2 for process management and auto-restart, configure Nginx as a reverse proxy, and add SSL with Certbot. The KVM 1 plan's 4GB RAM handles Node.js applications comfortably, even with multiple services running simultaneously.

4.8(156 reviews)
|Updated 2/19/2026

Install Node.js on Hostinger VPS

Install Node.js 20 LTS via NodeSource with: curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt install nodejs -y.

Use NodeSource for the most current and stable Node.js LTS release:

# SSH into your VPS
ssh root@YOUR_VPS_IP

# Install Node.js 20 LTS
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install nodejs -y

# Verify installation
node --version   # Should show v20.x.x
npm --version

# Optional: install yarn
npm install -g yarn

Deploy Your Node.js Application

Clone your project and install dependencies:

# Create a non-root deploy user
adduser deploy
usermod -aG sudo deploy

# Switch to deploy user
su - deploy

# Clone your project
git clone https://github.com/yourusername/your-app.git
cd your-app

# Install dependencies
npm ci --production

# Create .env file
cp .env.example .env
nano .env  # Edit your environment variables

# Test your app
npm start  # or node index.js

If your app starts without errors and responds on its configured port, you're ready for process management.

PM2: Keep Your App Running 24/7

PM2 is the Node.js process manager — it keeps your app running, restarts it on crashes, and manages multiple processes:

# Install PM2 globally
npm install -g pm2

# Start your app with PM2
pm2 start index.js --name my-app

# Alternative: use ecosystem file for full control
cat > ecosystem.config.js << 'EOF'
module.exports = {
  apps: [{
    name: 'my-app',
    script: 'index.js',
    instances: 'max',  // Use all CPU cores
    exec_mode: 'cluster',
    env: { NODE_ENV: 'production' },
    max_memory_restart: '500M'
  }]
};
EOF
pm2 start ecosystem.config.js

# Configure auto-start on server reboot
pm2 startup
pm2 save

# Useful PM2 commands
pm2 status           # View all processes
pm2 logs my-app     # View app logs
pm2 restart my-app  # Restart app
pm2 monit           # Live resource monitor

Nginx Reverse Proxy + SSL

Expose your Node.js app on port 80/443 with Nginx:

# Install Nginx and Certbot
apt install nginx certbot python3-certbot-nginx -y

# Create Nginx config
cat > /etc/nginx/sites-available/my-app << 'EOF'
server {
    server_name app.yourdomain.com;
    
    location / {
        proxy_pass http://localhost: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-Real-IP $remote_addr;
        proxy_cache_bypass $http_upgrade;
    }
}
EOF

# Enable the config
ln -s /etc/nginx/sites-available/my-app /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx

# Get SSL certificate
certbot --nginx -d app.yourdomain.com

Certbot automatically configures HTTPS and sets up auto-renewal. Your Node.js app is now served securely at https://app.yourdomain.com.

Frequently Asked Questions

What version of Node.js should I install on VPS?

Node.js 20 LTS (Long Term Support) is the recommended version for production deployments in 2026. LTS versions receive security updates for 30 months. Check nodejs.org/en/about/releases for the current LTS status.

Should I use PM2 or Docker for Node.js on VPS?

PM2 is simpler for single Node.js apps. Docker (with Docker Compose) is better for apps with dependencies (Redis, PostgreSQL, etc.) or when you want containerized deployments. Both provide 24/7 uptime and auto-restart on crashes.

How do I deploy code updates to my Node.js VPS?

Simple approach: SSH in, git pull, npm ci, pm2 restart app-name. Automated: set up a GitHub Actions workflow that SSHes into your VPS on push and deploys automatically. Zero-downtime: use PM2 cluster mode with pm2 reload.

How many Node.js apps can I run on Hostinger VPS?

Multiple — each Node.js process uses 50-300MB RAM depending on complexity. Hostinger KVM 1 (4GB) can run 5-10 typical Node.js apps simultaneously. Use Nginx to route different domains/paths to different Node.js ports.

Can I run Next.js on Hostinger VPS?

Yes — Next.js runs perfectly on Hostinger VPS. Deploy with: npm run build && pm2 start npm --name next-app -- start. Or use Docker: the official Next.js Dockerfile creates a production-optimized container.

  1. 1

    Install Node.js LTS

    Use NodeSource to install Node.js 20 LTS: curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt install nodejs.

  2. 2

    Deploy application

    Clone your repository, run npm ci --production, create your .env file, and test that the app starts correctly.

  3. 3

    Set up PM2

    Install PM2 globally, start your app with pm2 start, configure auto-startup, and save the process list.

  4. 4

    Configure Nginx

    Install Nginx, create a reverse proxy config pointing to your Node.js port, and enable the site.

  5. 5

    Add SSL with Certbot

    Install Certbot, run certbot --nginx -d yourdomain.com for automatic SSL certificate provisioning and renewal.

Get Node.js-Ready VPS — Hostinger $4.99/mo

4GB RAM, NVMe, KVM. Deploy Node.js apps in 20 minutes with our guide above.

Try Hostinger VPS
HF

Henry Fontaine

Chief of Staff & COO, RocketLabs

AI-native operator building the future of search visibility. Part of the team behind 3 tech exits and 400+ programmatic SEO deployments.

SEOAI OptimizationProgrammatic SEOGEOAEO
Follow on X →Published: 2/19/2026Updated: 2/19/2026