Skip to content

About

Production Linux VPS hardening, Node.js LTS provisioning, PM2, and Nginx reverse proxy automated setup script.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Automated Node.js VPS Hardening & Deployment Script

An automated, turnkey shell deployment script for Ubuntu 22.04 / 24.04 LTS and Debian 12 servers. Configures baseline Linux security, UFW firewall rules, Fail2ban brute-force protection, Node.js LTS, PM2 process management, and Nginx reverse proxy with SSL.

Ubuntu Debian Node.js PM2 Nginx License VPS


⚡ What It Automates

  1. System & Security Hardening:
    • Updates APT package repositories and enables unattended security patches.
    • Installs and configures UFW Firewall (denies incoming by default, whitelists SSH, HTTP 80, HTTPS 443).
    • Configures Fail2ban to protect SSH from brute-force attempts.
  2. Dedicated User Architecture:
    • Creates a non-root application user (deploy by default) with sudo privileges.
  3. Node.js Environment:
    • Installs Node.js LTS via official NodeSource distribution repositories.
    • Installs PM2 process supervisor with systemd automatic reboot hooks.
  4. Nginx Reverse Proxy & SSL (Optional):
    • Configures an Nginx virtual host with WebSocket and proxy headers.
    • Automates Let's Encrypt SSL certificate issuance via Certbot.

🚀 One-Line Execution

Run directly on a fresh Ubuntu or Debian VPS:

curl -fsSL https://raw.githubusercontent.com/VexaNode-Dev/node-vps-deploy/main/deploy.sh | sudo bash -s -- --node-version 20 --user deploy

🛠️ CLI Options

Flag Default Description
--dry-run false Prints all actions without modifying system state
--node-version <ver> 20 Node.js major version (e.g., 18, 20, 22)
--user <username> deploy Non-root application user to create
--domain <domain> None Optional: Domain name for Nginx reverse proxy
--port <port> 3000 Application upstream local port for reverse proxy

🧪 Testing and Verification

Verify script syntax and dry-run execution locally:

git clone https://github.com/VexaNode-Dev/node-vps-deploy.git
cd node-vps-deploy
bash tests/test_syntax.sh

☁️ Deploy on VexaNode High-Performance VPS

Need dedicated compute resources with unmetered 10Gbps bandwidth? Deploy this script directly to VexaNode KVM VPS instances with instant provisioning and enterprise DDoS defense.


📜 License

MIT License. Developed by VexaNode-Dev. Need support? Join our Discord at discord.gg/devz.

About

Production Linux VPS hardening, Node.js LTS provisioning, PM2, and Nginx reverse proxy automated setup script.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages