← Back to blog
SvelteKitDevOpsTutorial
Getting Started with SvelteKit on a Budget VPS
How to deploy a fast, lightweight SvelteKit site on a cheap VPS using adapter-node and nginx.
SvelteKit is one of the best choices for deploying to a cheap VPS. Here's why and how.
Why SvelteKit?
Svelte is a compiler, not a runtime. It compiles your components to vanilla JavaScript at build time. There's no virtual DOM shipped to the client. The result is smaller bundles and lower server memory usage compared to React or Vue frameworks.
With adapter-node, you get a standalone Node.js server that runs your entire site — SSR, API routes, static assets — from a single process.
Setup
npm create svelte@latest my-app
cd my-app
npm install
npm install -D @sveltejs/adapter-node
Update svelte.config.js:
import adapter from '@sveltejs/adapter-node';
export default { kit: { adapter: adapter() } };
Build and run:
npm run build
node build
Reverse proxy with nginx
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Systemd service
[Unit]
Description=My Website
After=network.target
[Service]
Type=simple
User=www
WorkingDirectory=/home/www/app
ExecStart=/usr/bin/node build
Restart=on-failure
[Install]
WantedBy=multi-user.target
That's it. Your site is live, behind nginx, with automatic restarts. Total memory usage: ~50-80MB.