For SvelteKit
SvelteKit, served from a real VM
The setup on this page costs $19.89 a month, with no egress line.
Why SvelteKit on Edge
Tiny apps, real CPU, predictable bills
adapter-node, nothing else
Build with adapter-node and run node build on any Edge VM. Plain Linux, a small memory footprint and no platform-specific step.Real CPU, no cold starts
One long-running Node process on a real VM. Load functions answer in the same time on the first request as on the millionth.Images at build time or on request
Keep enhanced:img for bundled assets. Send uploads and CMS images through the CDN for resizing and AVIF/WebP on the fly.Uploads through any AWS SDK client
Any AWS SDK client pushes uploads and serves downloads through Edge Storage. The same code runs in dev and production.Immutable assets cached, the VM for the rest
_app/immutable assets cache in 988 locations. Your VM only sees the requests that actually need it.Push from your CI
GitHub Actions, GitLab CI or a single rsync. The Edge CLI scripts everything else, end to end.
Reference architecture
adapter-node on a VM, the CDN in front
Browsers
app.acme.dev via Edge DNS
app.acme.dev
caches _app/immutable and static/
?width=480&format=auto
uploads, transformed at the edge
node build :3000
adapter-node, systemd, Nginx
acme-files
uploads and downloads
- Compute
Runs node build, the adapter-node output, as a systemd service.
- Storage
Holds uploads, downloads and overflow assets. Any S3 client works.
- CDN
Caches _app/, static/ and prerendered pages in every location.
- Image optimisation
Resize, crop and AVIF/WebP from the URL, for images the build never sees.
- DNS
Anycast DNS for production, staging and preview subdomains.
- Shield
Scores form actions server-side with one call. No CAPTCHA widget.
- Assist
One script tag in app.html adds answers grounded in your content.
Deploy
Build with adapter-node, live in four steps
- 01
Switch to adapter-node
Install @sveltejs/adapter-node as a dev dependency and swap it in. npm run build now writes a standalone Node app to build/.
svelte.config.jsimport adapter from '@sveltejs/adapter-node' /** @type {import('@sveltejs/kit').Config} */ export default { kit: { adapter: adapter() }, } - 02
Create a VM and copy the build
The nodejs library script installs Node 22 and an Nginx reverse proxy on first boot. Install production dependencies on the VM.
shell$ edge compute create --name svelte --size s-2vcpu-4gb \ --image ubuntu-24 --region london --script nodejs $ npm run build $ rsync -a build package.json package-lock.json root@<vm-ip>:/srv/app/ $ ssh root@<vm-ip> "cd /srv/app && npm ci --omit=dev" - 03
Run it as a service
systemd keeps the process up and restarts it on failure. Set ORIGIN so form actions pass SvelteKit's CSRF check behind the proxy.
/etc/systemd/system/svelte.service[Unit] Description=SvelteKit app After=network.target [Service] WorkingDirectory=/srv/app ExecStart=/usr/bin/node build Environment=PORT=3000 NODE_ENV=production Environment=ORIGIN=https://app.acme.dev Restart=always [Install] WantedBy=multi-user.target - 04
Front it with the CDN
SSL is issued automatically. Hashed _app/immutable files are cached for as long as their headers allow.
shell$ edge cdn create --name acme-app $ edge cdn domains add cdn-5d1f08 \ --domain app.acme.dev \ --origin https://<vm-ip> \ --jit-image
Prefer to hand it off? Give the job to your AI agent or have our engineers do it.
What it costs
A small app deserves a small bill
- No per-invocation or per-GB-second pricing
- Image transforms included with the CDN
- adapter-node output runs anywhere Node does
Estimated monthly bill on Edge
~300k page views, 2.5M requests, 15 GB of uploads
- Compute$19.24Standard VM, 2 vCPU, 4 GiB, 80 GB NVMe
- CDN$0.502.5M requests: first 500k free, 2M × $0.25 per million
- Storage$0.1515 GB: first 5 GB free, 10 GB × $0.015
- DNS$0.00Production, staging and preview records
- Egress$0.00
FAQ
Adapters, form actions and prerendering
Which adapter should I use?
Do form actions and server-only modules work?
What happens to prerendered pages?
How do I run it as a service?
Can I get a preview per pull request?
Drop-in services
Checks inside form actions, nothing shipped to the client
- Edge ShieldBot protection
POST /siteverify → score: 94Check the humanity score inside a form action before you accept the submission. Nothing ships to the client.
Free forever, with unlimited widgets. No puzzles for visitors.Explore - Edge AssistAI answers
<script src="…/assist.js">One line in app.html and every route gets an answer box grounded in your site's content.
Free tier: 250 answered questions a monthExplore
Put your SvelteKit app on one VM and a CDN
Bring your repo. adapter-node, one VM and one CDN deployment, live in minutes.
Billed hourly from a prepaid balance. Egress is free on every product.