[{"data":1,"prerenderedAt":117},["ShallowReactive",2],{"seo-verification":3,"blog-deployer-nextjs-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},46,"deployer-nextjs-vps","Deploy a Next.js Application on a VPS","Deploy Next.js on a VPS: Node.js, PM2, Nginx, SSL, and SSR. A complete guide for developers and agencies who want to self-host.",8,2120,false,"2026-05-05T00: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-nextjs-vps-poster.svg",{"categorySlug":18,"appSlug":27},"nextjs","Next.js combines server-side rendering, static generation, and API routes in a single React framework. Deploying it on a VPS rather than on a proprietary platform frees you from function quotas, bandwidth limits, and vendor lock-in, while keeping SSR fully operational.",[30,34,44,47,69],{"type":31,"title":32,"body":33},"h2","Why Self-Host Next.js on a VPS?","Next.js is often associated with a specific hosting platform, but its standalone Node.js server runs perfectly on any VPS. Self-hosting becomes worthwhile as soon as you make intensive use of SSR, ISR (incremental static regeneration), or API routes: these features consume billed invocations on managed platforms, whereas they are free and unlimited on your server. You control the ISR cache on disk, the bandwidth of optimized images, and the function execution time, with no 10-second limit. For an agency hosting several client sites, a VPS pools the costs and simplifies billing.",{"type":35,"title":36,"items":37},"ul","Concrete Benefits of a Self-Hosted Next.js",[38,39,40,41,42,43],"SSR and API routes with no invocation quota or per-function billing.","Persistent ISR cache on disk, no revalidation lost between deployments.","Included bandwidth, ideal for image- and video-rich sites.","Several Next.js projects on a single VPS, pooled under Nginx.","`next\u002Fimage` image optimization served locally with no per-transformation extra cost.","Build and deployment controlled via Git, CI\u002FCD, or a simple `git pull` and rebuild.",{"type":31,"title":45,"body":46},"Hardware and Software Prerequisites","The Next.js build is memory-hungry: plan for at least 2 GB of RAM (4 GB for a large project with many pages), otherwise the build may fail for lack of memory. On the runtime side, 1 to 2 vCPU are enough to serve SSR. Install Node.js 18 or 20 LTS, either natively with `nvm` or via a `node:20-alpine` Docker image. Use PM2 to supervise the Node process, or Docker for isolation. A domain pointed to the VPS is required for SSL. Enable `output: 'standalone'` in `next.config.js` for a lightweight deployment.",{"type":48,"title":49,"steps":50},"steps","Deploy Next.js Step by Step",[51,54,57,60,63,66],{"title":52,"body":53},"Prepare the Server","Over SSH, install Node.js 20 LTS and PM2 (`npm install -g pm2`), or Docker. Clone the repository and create `.env.production` with your variables (`NEXT_PUBLIC_*` for the client, server secrets for the API routes).",{"title":55,"body":56},"Build the Application","Run `npm ci`, then `npm run build`. With `output: 'standalone'`, Next.js generates a self-contained `.next\u002Fstandalone` folder containing only the necessary dependencies, which greatly lightens the image.",{"title":58,"body":59},"Start the Node Server","Start the server with `pm2 start node --name nextjs -- .next\u002Fstandalone\u002Fserver.js` on port 3000, or via a Docker container. Configure `pm2 startup` and `pm2 save` for automatic restart on VPS reboot.",{"title":61,"body":62},"Configure Nginx as the Front End","Create a server block that does `proxy_pass http:\u002F\u002Flocalhost:3000`, forwards the `Host` and `X-Forwarded-For` headers, and serves `\u002F_next\u002Fstatic\u002F` directly from disk to relieve Node. Enable gzip compression.",{"title":64,"body":65},"Install the SSL Certificate","Obtain a Let's Encrypt certificate via Certbot for `yourdomain.com`, force the HTTPS redirect, and configure automatic renewal. Verify that the `X-Forwarded-Proto` headers are properly forwarded for SSR.",{"title":67,"body":68},"Set Up Deployments","Automate the `git pull && npm ci && npm run build && pm2 reload nextjs` cycle via a script or a Git webhook. PM2's `reload` ensures a zero-downtime restart between two versions.",{"type":70,"body":71},"tip","If you use ISR, mount a persistent volume for the `.next\u002Fcache` folder so that revalidated pages survive redeployments. Without this, each rebuild starts from an empty cache and causes a spike of on-the-fly generation. For several Node instances behind a load balancer, externalize this cache to shared storage or Redis with a custom cache handler.","Host Your Next.js Without Limits","The ServOrbit Cloud VPS offers a preconfigured template with Node.js, PM2, Nginx, and automatic SSL, perfect for serving your Next.js applications in SSR without quotas.","Deploy My Next.js 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},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.",591,"2026-05-08T00: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-nodejs-vps-poster.svg",{"categorySlug":18,"appSlug":103},"nodejs",{"id":105,"slug":106,"title":107,"excerpt":108,"readTime":11,"views":109,"isPinned":13,"publishedAt":110,"category":111,"categories":112,"featuredImage":23,"bgImage":24,"posterImage":114,"relatedSolution":115},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},[113],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-django-vps-poster.svg",{"categorySlug":18,"appSlug":116},"django",1785628430147]