Deploying a Node.js Application on a VPS in Nepal: Step-by-Step

Getting a Node.js app running on localhost is the easy part. Getting it running reliably on a live VPS, staying up after you close your laptop, restarting itself if it crashes, and serving traffic over a real domain with SSL, is where a lot of first-time deployments in Nepal get stuck. None of the individual steps are hard. It's the specific order and a couple of easy-to-miss details that trip people up.

Step 1: Install Node.js Properly (Not the Distro's Default Package)

Your Linux distribution's default package manager often ships an outdated Node.js version. Use NodeSource's setup script or a version manager like nvm instead, so you control the exact version your application needs rather than whatever happened to be packaged for your distro. Confirm with node -v and npm -v once installed.

Step 2: Get Your Code Onto the Server

Clone your repository directly with Git if it's hosted on GitHub/GitLab, or upload via SFTP if it isn't version-controlled yet (it should be, but that's a separate conversation). Run npm install to pull dependencies, and set up your .env file with production values, database credentials, API keys, port configuration, separate from whatever you used locally.

Step 3: Keep the App Running With PM2

Running node app.js directly works until you close the terminal, at which point the process dies with it. PM2 is the standard solution: it keeps your Node process running in the background, automatically restarts it if it crashes, and can be configured to start automatically if the VPS itself reboots. Install it with npm install -g pm2, start your app with pm2 start app.js --name myapp, then run pm2 startup and pm2 save so it survives a server restart.

Get a VPS Built for Nepal, Not Just Sold Here

WebsNP's VPS plans start at NPR 2,500/month with KVM virtualization and NVMe SSD storage, priced honestly in NPR with eSewa and Khalti accepted at checkout. Our Nepali support team is on WhatsApp when you actually need help, not a ticket queue in another timezone.

See VPS Plans

Step 4: Put Nginx in Front of It as a Reverse Proxy

Don't expose your Node app's port (commonly 3000) directly to the internet. Install Nginx and configure it as a reverse proxy, forwarding requests from standard port 80/443 to your app's internal port. This gives you a proper place to handle SSL termination, serve static files efficiently, and eventually run multiple applications on the same server behind different domains, all through one entry point.

Step 5: Add SSL With Let's Encrypt

With Nginx handling your domain, Certbot makes adding a free SSL certificate from Let's Encrypt a two-command process, and it auto-renews going forward. There's no reason to run a production app without HTTPS in 2026, and this step takes a few minutes.

Step 6: Set Up Basic Monitoring and Logs

pm2 logs shows your application's live output for quick debugging, and pm2 monit gives a real-time view of CPU and memory per process. For anything beyond casual monitoring, forwarding logs somewhere persistent, rather than relying only on what PM2 keeps in memory, saves real debugging time later when something goes wrong at 2am and you need to know what happened.

Where First-Time Deployments Usually Go Wrong

Forgetting to open port 80/443 in the firewall while leaving the app's raw port exposed instead; not setting pm2 startup, so a server reboot silently kills the app until someone notices; and running everything as root instead of a limited deploy user, which turns a routine mistake into a much bigger one. All three are avoidable with the sequence above.

If You'd Rather Skip the Setup and Just Ship

WebsNP's VPS plans run on KVM with root access, giving you full control for exactly this kind of Node.js deployment, and our team can handle the initial server setup, Nginx, PM2, and SSL configuration for you if you'd rather focus on the application itself. Message us on WhatsApp with what you're deploying and we'll get the server side ready.