[{"data":1,"prerenderedAt":129},["ShallowReactive",2],{"seo-verification":3,"blog-deploying-a-sveltekit-application-on-a-vps-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"slugs":9,"title":12,"excerpt":13,"readTime":14,"views":15,"isPinned":16,"publishedAt":17,"category":18,"categories":24,"featuredImage":26,"bgImage":27,"posterImage":28,"relatedSolution":29,"intro":32,"sections":33,"ctaTitle":79,"ctaBody":80,"ctaButton":81,"ctaUrl":82,"relatedPosts":83},53,"deploying-a-sveltekit-application-on-a-vps",{"fr":10,"en":8,"ar":11},"deployer-sveltekit-vps","نشر-تطبيق-sveltekit-على-خادم-vps","Deploying a SvelteKit application on a VPS","Deploy a SvelteKit app on a Cloud VPS with the Node adapter, Docker, PM2, reverse proxy and SSL. A tutorial for front-end developers.",3,0,false,"2026-04-28T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},4,"Development","developpement","bg-warning\u002F10 text-warning","dev",[25],{"id":19,"name":20,"slug":21,"color":22,"icon":23},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fdeployer-sveltekit-vps-poster.svg",{"categorySlug":30,"appSlug":31},"development","sveltekit-stack","SvelteKit produces high-performance full-stack applications, but most tutorials assume a serverless deployment. On a VPS, the Node adapter gives you a real long-running server, with no cold start or execution limit. Here is how to deploy it cleanly with Docker and a reverse proxy.",[34,38,48,51,73,76],{"type":35,"title":36,"body":37},"h2","Why self-host SvelteKit on a VPS","SvelteKit adapts to many targets via its adapters (Vercel, Netlify, Cloudflare…), but the official `@sveltejs\u002Fadapter-node` adapter produces a standalone Node server, perfect for a VPS. Instead of splitting your application into serverless functions subject to cold starts and execution-time limits, you get a persistent process that keeps its database connections open and responds without startup latency. Form actions, server-side `load` functions and `+server.ts` endpoints run in a single runtime that you control. On a VPS, you also avoid per-invocation billing, common on front-end platforms, which becomes unpredictable as soon as traffic rises.",{"type":39,"title":40,"items":41},"ul","Concrete benefits",[42,43,44,45,46,47],"Persistent Node server via adapter-node: no cold start on server routes","Database connections kept open in a pool, without reconnecting on each request","No per-invocation billing: stable cost even with high and irregular traffic","Form actions and `+server.ts` endpoints executed without an imposed duration limit","WebSockets and SSE possible, where serverless forbids or complicates them","Environment variables and secrets managed directly, without a third-party platform dashboard",{"type":35,"title":49,"body":50},"Hardware and software prerequisites","A SvelteKit application in Node mode consumes moderately: a VPS with 1 vCPU and 2 GB of RAM suits a medium-traffic site; scale up to 2 vCPU \u002F 4 GB if you co-locate a PostgreSQL database and have heavy server `load` functions. Install Node.js 20 LTS, and either Docker or PM2 to manage the process as a daemon. Nginx will serve as a reverse proxy. Point your domain at the VPS IP. The build (`build\u002F` generated by adapter-node) stays light; 5 to 10 GB of disk is enough with the `node_modules`.",{"type":52,"title":53,"steps":54},"steps","Step-by-step deployment",[55,58,61,64,67,70],{"title":56,"body":57},"Install and configure the Node adapter","Add `@sveltejs\u002Fadapter-node` and declare it in `svelte.config.js` (`adapter: adapter()`). It is what transforms your app into a standalone Node server rather than a serverless bundle.",{"title":59,"body":60},"Build the application","Run `npm run build`. SvelteKit generates a `build\u002F` folder containing `index.js`, the server's entry point. You test it locally with `node build`; it listens by default on port 3000.",{"title":62,"body":63},"Containerize or daemonize the process","With Docker: a `node:20-alpine` Dockerfile that copies `build\u002F` and `package.json`, installs the production dependencies (`npm ci --omit=dev`) and runs `node build`. Without Docker: use PM2 with `pm2 start build\u002Findex.js --name svelte-app` for automatic restart.",{"title":65,"body":66},"Inject the runtime configuration","Pass `PORT`, `ORIGIN` (indispensable for SvelteKit to validate form actions) and your secrets via the environment: `ORIGIN=https:\u002F\u002Fmydomain.com`. Without a correct `ORIGIN`, form actions will fail in production with a CSRF error.",{"title":68,"body":69},"Configure Nginx as a front end","Create a vhost with `proxy_pass http:\u002F\u002F127.0.0.1:3000;` and the `proxy_set_header Host` and `X-Forwarded-Proto $scheme` headers. Enable `proxy_http_version 1.1` and the `Upgrade` headers if you use WebSockets.",{"title":71,"body":72},"Secure with Let's Encrypt","Run `certbot --nginx -d mydomain.com`. Once the certificate is installed, check that `ORIGIN` matches the final HTTPS URL, otherwise form submissions will be rejected.",{"type":74,"body":75},"tip","Cache the output of static routes with the `Cache-Control` header in your `load` functions, and enable precompression: adapter-node automatically serves `.gz` and `.br` files if they exist. Build with precompression by setting `precompress: true` in the adapter options. On the process management side, prefer PM2's cluster mode (`pm2 start build\u002Findex.js -i max`) to make use of all the VPS cores under a high CPU load.",{"type":35,"title":77,"body":78},"Deploy SvelteKit in One Click from the Marketplace","The ServOrbit Marketplace offers a **SvelteKit Stack** template that automatically sets up Node.js LTS, PM2, and Nginx on your Ubuntu 24.04 VPS in minutes. Pick a VPS, select the template, and get a production-ready environment for your SvelteKit project — no system command line needed. Provisioning installs the complete toolchain; all that remains is transferring your build and configuring Nginx for your domain.","Your SvelteKit Environment Ready in Minutes","The SvelteKit Stack template automatically configures Node.js LTS, PM2, and Nginx — ready to host your SvelteKit application in SSR or static mode.","Deploy My SvelteKit Stack","\u002Fmarketplace\u002Fdevelopment\u002Fsveltekit-stack",[84,99,114],{"id":85,"slug":86,"slugs":87,"title":90,"excerpt":91,"readTime":19,"views":15,"isPinned":16,"publishedAt":92,"category":93,"categories":94,"featuredImage":26,"bgImage":27,"posterImage":96,"relatedSolution":97},5,"deploying-laravel-on-a-vps-a-production-guide",{"fr":88,"en":86,"ar":89},"deployer-laravel-vps","نشر-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.","2026-02-09T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},[95],{"id":19,"name":20,"slug":21,"color":22,"icon":23},"\u002Fblog\u002Fcovers\u002Fdeployer-laravel-vps-poster.svg",{"categorySlug":23,"appSlug":98},"laravel-stack",{"id":100,"slug":101,"slugs":102,"title":105,"excerpt":106,"readTime":14,"views":15,"isPinned":16,"publishedAt":107,"category":108,"categories":109,"featuredImage":26,"bgImage":27,"posterImage":111,"relatedSolution":112},43,"deploy-a-nodejs-application-on-a-vps",{"fr":103,"en":101,"ar":104},"deployer-nodejs-vps","نشر-تطبيق-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.","2026-05-08T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},[110],{"id":19,"name":20,"slug":21,"color":22,"icon":23},"\u002Fblog\u002Fcovers\u002Fdeployer-nodejs-vps-poster.svg",{"categorySlug":30,"appSlug":113},"nodejs-stack",{"id":115,"slug":116,"slugs":117,"title":120,"excerpt":121,"readTime":14,"views":15,"isPinned":16,"publishedAt":122,"category":123,"categories":124,"featuredImage":26,"bgImage":27,"posterImage":126,"relatedSolution":127},44,"deploy-a-django-application-on-a-vps",{"fr":118,"en":116,"ar":119},"deployer-django-vps","نشر-تطبيق-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.","2026-05-07T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},[125],{"id":19,"name":20,"slug":21,"color":22,"icon":23},"\u002Fblog\u002Fcovers\u002Fdeployer-django-vps-poster.svg",{"categorySlug":30,"appSlug":128},"django",1787580996576]