Docs / Programming & Development / How to Deploy a SvelteKit Application on a VPS

How to Deploy a SvelteKit Application on a VPS

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 28 views · 1 min read

What Is SvelteKit?

SvelteKit is a framework for building web applications using Svelte. It provides server-side rendering, file-based routing, and flexible deployment adapters. Running SvelteKit on your Breeze gives you full control over your application stack.

Prerequisites

  • A Breeze running Ubuntu 22.04 or later
  • Node.js 18+ installed
  • Nginx installed

Step 1: Configure the Node Adapter

Install the Node adapter for server-side deployment:

npm install -D @sveltejs/adapter-node

Update svelte.config.js:

import adapter from '@sveltejs/adapter-node';
export default {
    kit: { adapter: adapter() }
};

Step 2: Build and Run

npm run build
pm2 start build/index.js --name "sveltekit-app"
pm2 save && pm2 startup

Step 3: Nginx Reverse Proxy

server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
    }
}
sudo ln -s /etc/nginx/sites-available/sveltekit /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Step 4: Enable SSL

sudo certbot --nginx -d yourdomain.com

Static Adapter Alternative

For fully static sites, use @sveltejs/adapter-static instead. This pre-renders all pages at build time so Nginx serves HTML files directly with no running Node.js process.

Was this article helpful?