[{"data":1,"prerenderedAt":117},["ShallowReactive",2],{"seo-verification":3,"blog-deployer-astro-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},52,"deployer-astro-vps","Deploying an Astro application on a VPS","Deploy an Astro site on a Cloud VPS: static build or SSR via the Node adapter, Docker, Nginx and SSL. A guide for front-end developers.",7,324,false,"2026-04-29T00: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-astro-vps-poster.svg",{"categorySlug":18,"appSlug":27},"astro","Astro generates an ultra-fast static site by default, but it can also render pages server-side via its Node adapter. Depending on your need, you serve simple HTML files or a real SSR server. Here are both approaches on a VPS, with a reverse proxy and cache.",[30,34,44,47,69],{"type":31,"title":32,"body":33},"h2","Why self-host Astro on a VPS","Astro has a peculiarity: it can produce either a 100% static site (`output: 'static'`), or an application with on-demand server rendering (`output: 'server'` via `@astrojs\u002Fnode`). This duality makes the VPS very relevant. In static mode, you serve HTML files directly from Nginx, without any Node process: maximum performance and minimal footprint. In SSR, you launch a Node server that renders pages dynamically, useful for personalized content or integrated API endpoints. On a VPS, you choose your strategy without being locked into the model imposed by a front-end deployment platform. You also control the HTTP cache, the security headers and Brotli compression, where front-end hosts handle that as a black box.",{"type":35,"title":36,"items":37},"ul","Concrete benefits",[38,39,40,41,42,43],"Freedom of output mode: pure static or SSR Node, or even hybrid per route","In static mode, Nginx serves the files without any Node process: near-zero RAM, maximum throughput","Full control of the HTTP cache, security headers (CSP, HSTS) and Brotli compression","No bandwidth limit or request quota imposed by a front-end platform","Astro API endpoints hosted on the same domain, without a third-party serverless function","Reproducible deployment via Docker: the same build locally and in production",{"type":31,"title":45,"body":46},"Hardware and software prerequisites","A static Astro site fits on the smallest VPS imaginable: 1 vCPU and 1 GB of RAM is more than enough, since Nginx only serves files. In SSR mode, plan for 2 GB for the Node process and rendering peaks. Install Node.js 20 LTS to build (or build in CI), Docker if you containerize, and Nginx as a front end. Point `mydomain.com` and `www.mydomain.com` at the VPS IP. Count 5 GB of disk; the `dist\u002F` folder of a static site generally weighs a few MB.",{"type":48,"title":49,"steps":50},"steps","Step-by-step deployment",[51,54,57,60,63,66],{"title":52,"body":53},"Choose the output mode","In `astro.config.mjs`, set `output: 'static'` for a content site, or `output: 'server'` with `adapter: node({ mode: 'standalone' })` if you need SSR. This choice conditions the whole rest of the deployment.",{"title":55,"body":56},"Build the application","Run `npm run build`. In static mode, you get a `dist\u002F` folder containing the HTML, CSS and JS ready to serve. In SSR, you additionally get a `dist\u002Fserver\u002Fentry.mjs` to run with Node.",{"title":58,"body":59},"Serve the static files with Nginx (static mode)","Point your vhost's `root` directive at `\u002Fvar\u002Fwww\u002Fastro\u002Fdist` and enable `try_files $uri $uri\u002F \u002F404.html;`. Add `gzip on;` and long `Cache-Control` headers on versioned assets. No container is needed.",{"title":61,"body":62},"Containerize the Node server (SSR mode)","For SSR, create a Dockerfile based on `node:20-alpine` that copies `dist\u002F` and runs `node .\u002Fdist\u002Fserver\u002Fentry.mjs`. Expose port 4321 and start with `docker compose up -d`. Nginx will then do a `proxy_pass` to this port.",{"title":64,"body":65},"Configure the reverse proxy and compression","Whether you are in static mode or in SSR behind Node, declare the Nginx vhost with `www` redirected to the apex domain. Enable Brotli if the module is available for assets even lighter than gzip.",{"title":67,"body":68},"Enable SSL","Run `certbot --nginx -d mydomain.com -d www.mydomain.com`. Force the redirect to HTTPS and add the `Strict-Transport-Security` header. Validate the deployment with a Lighthouse test from your browser.",{"type":70,"body":71},"tip","Even for an SSR site, leverage Astro's hybrid rendering: mark static pages with `export const prerender = true` so they are generated at build time and served directly by Nginx, reserving the Node process only for genuinely dynamic routes. This drastically reduces the server load. And place an Nginx `proxy_cache` in front of low-change-frequency SSR pages to absorb traffic spikes.","Host your Astro site on a fast VPS","The ServOrbit Cloud VPS delivers a preconfigured Node and Nginx environment, ideal for serving a static Astro site at maximum throughput or running its SSR rendering with dedicated resources.","Discover the Cloud VPS","\u002Fvps-cloud",[77,90,104],{"id":78,"slug":79,"title":80,"excerpt":81,"readTime":11,"views":82,"isPinned":13,"publishedAt":83,"category":84,"categories":85,"featuredImage":23,"bgImage":24,"posterImage":87,"relatedSolution":88},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.",2840,"2026-02-09T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[86],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-laravel-vps-poster.svg",{"categorySlug":20,"appSlug":89},"laravel-stack",{"id":91,"slug":92,"title":93,"excerpt":94,"readTime":95,"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.",8,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":95,"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",1785628424886]