[{"data":1,"prerenderedAt":117},["ShallowReactive",2],{"seo-verification":3,"blog-deployer-nodejs-vps-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"title":9,"excerpt":10,"readTime":11,"views":12,"isPinned":13,"publishedAt":14,"category":15,"categories":21,"featuredImage":23,"bgImage":24,"posterImage":25,"relatedSolution":26,"intro":28,"sections":29,"ctaTitle":72,"ctaBody":73,"ctaButton":74,"ctaUrl":75,"relatedPosts":76},43,"deployer-nodejs-vps","Deploy a Node.js Application on a VPS","Deploy a Node.js application to production on a VPS: PM2, Nginx reverse proxy, Let's Encrypt SSL, and automatic startup at boot.",8,591,false,"2026-05-08T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},4,"Development","developpement","bg-warning\u002F10 text-warning","dev",[22],{"id":16,"name":17,"slug":18,"color":19,"icon":20},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fdeployer-nodejs-vps-poster.svg",{"categorySlug":18,"appSlug":27},"nodejs","Running a Node.js application in production takes more than a simple `node app.js`: you need a process manager that restarts the app if it crashes, a reverse proxy for HTTPS, and automatic startup at boot. On a VPS, you control every link in this chain, unlike a managed platform that bills you per usage.",[30,34,44,47,69],{"type":31,"title":32,"body":33},"h2","Why Deploy Node.js on a VPS Rather Than on a Managed Platform?","Serverless and PaaS platforms are convenient to start with, but their cost climbs with traffic, and they impose constraints (timeouts, cold starts, WebSocket connection limits). A VPS gives you a persistent Node.js process, long-lived connections (WebSocket, SSE) with no artificial limit, dedicated resources, and a predictable fixed cost. You decide on the Node version, the process manager, the reverse proxy, and the update strategy, without depending on a provider's conventions.",{"type":35,"title":36,"items":37},"ul","What You Gain with a VPS for Node.js",[38,39,40,41,42,43],"Persistent Node.js process, ideal for WebSocket, SSE, and long-running tasks with no cold start","Automatic restart on crash and on server reboot thanks to PM2","Cluster mode to use all the VPS's CPU cores without changing your code","Nginx reverse proxy in front of Node for HTTPS, compression, and static files","Fixed, predictable cost, with no per-request billing or scaling surprises","Full control over the Node.js version and system dependencies",{"type":31,"title":45,"body":46},"Prerequisites","A standard Node.js application (Express, Nest, or Fastify API) runs comfortably on a VPS with 1 to 2 vCPU and 1 to 2 GB of RAM; plan for more RAM if you compile a heavy frontend at build time or run workers. Install Node.js via nvm or the NodeSource repository to pin an LTS version, along with PM2 as the process manager and Nginx as the reverse proxy. You need a domain pointing to the VPS IP and ports 80\u002F443 open.",{"type":48,"title":49,"steps":50},"steps","Deploy a Node.js Application to Production",[51,54,57,60,63,66],{"title":52,"body":53},"Prepare the VPS and Install Node.js","On an Ubuntu 22.04 VPS, update the system and install an LTS version of Node via nvm (`nvm install --lts`) or the NodeSource repository. Check with: `node -v` and `npm -v`. Create a non-root user dedicated to the application rather than running everything as root.",{"title":55,"body":56},"Fetch the Code and Build","Clone your repository on the VPS, install the production dependencies (`npm ci --omit=dev`), and run the build if needed (`npm run build`). Put sensitive variables in an uncommitted `.env` file or in the service's environment variables.",{"title":58,"body":59},"Launch the Application with PM2","Install PM2 globally (`npm install -g pm2`), then start the app: `pm2 start app.js --name monapp -i max`. The `-i max` flag enables cluster mode across all cores. PM2 automatically restarts the process if it crashes.",{"title":61,"body":62},"Enable Automatic Startup at Boot","Generate the systemd script with `pm2 startup`, run the displayed command, then freeze the current state with `pm2 save`. On the next VPS reboot, your application will be restarted automatically, with no intervention.",{"title":64,"body":65},"Configure Nginx as a Reverse Proxy","Install Nginx and create a virtual host for your domain that proxies to Node's local port (e.g., `proxy_pass http:\u002F\u002Flocalhost:3000;`). Add the `Upgrade` and `Connection` headers if you use WebSocket. Test the config (`nginx -t`), then reload.",{"title":67,"body":68},"Secure with HTTPS Using Let's Encrypt","Install Certbot and its Nginx plugin, then run `certbot --nginx -d yourdomain.com`. Certbot obtains the certificate, configures the HTTP→HTTPS redirect, and schedules automatic renewal. Your Node application is now served over HTTPS.",{"type":70,"body":71},"tip","For zero-downtime deployments, combine PM2 cluster mode with `pm2 reload monapp` rather than `restart`: PM2 restarts the workers one by one, always keeping at least one instance available during the update. Then monitor memory with `pm2 monit` and set an automatic restart limit (`--max-memory-restart 500M`) to prevent memory leaks in production.","Put Your Node.js Application into Production on a Cloud VPS","Deploy a ServOrbit Cloud VPS with the Development template: Node.js, PM2, and Nginx preconfigured to move your application into production over HTTPS.","View Cloud VPS","\u002Fvps-cloud",[77,91,104],{"id":78,"slug":79,"title":80,"excerpt":81,"readTime":82,"views":83,"isPinned":13,"publishedAt":84,"category":85,"categories":86,"featuredImage":23,"bgImage":24,"posterImage":88,"relatedSolution":89},5,"deployer-laravel-vps","Deploying Laravel on a VPS: a production guide","Take Laravel to production on a VPS: PHP, workers, cache, database, reverse proxy and HTTPS configured cleanly.",7,2840,"2026-02-09T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[87],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-laravel-vps-poster.svg",{"categorySlug":20,"appSlug":90},"laravel-stack",{"id":92,"slug":93,"title":94,"excerpt":95,"readTime":11,"views":96,"isPinned":13,"publishedAt":97,"category":98,"categories":99,"featuredImage":23,"bgImage":24,"posterImage":101,"relatedSolution":102},44,"deployer-django-vps","Deploy a Django Application on a VPS","Deploy Django on a VPS: Gunicorn, Nginx, PostgreSQL, Docker, and SSL. A complete guide for Python developers who want to self-host.",628,"2026-05-07T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[100],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-django-vps-poster.svg",{"categorySlug":18,"appSlug":103},"django",{"id":105,"slug":106,"title":107,"excerpt":108,"readTime":82,"views":109,"isPinned":13,"publishedAt":110,"category":111,"categories":112,"featuredImage":23,"bgImage":24,"posterImage":114,"relatedSolution":115},45,"deployer-fastapi-vps","Deploy a FastAPI Application on a VPS","Deploy FastAPI on a VPS with Uvicorn, Gunicorn, Nginx, and SSL. A guide for Python developers who want a self-hosted async API.",665,"2026-05-06T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[113],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-fastapi-vps-poster.svg",{"categorySlug":18,"appSlug":116},"fastapi",1785628430583]