Edge
SvelteKit logo

For SvelteKit

SvelteKit, served
from real VMs

adapter-node + a small VM + a global CDN. The cleanest production recipe for SvelteKit — no platform-specific build, no cold starts, no egress fees on the way out.

# svelte.config.js

import adapter from '@sveltejs/adapter-node'

export default { kit: { adapter: adapter() } }

# Build

$ npm run build

# Provision the VM

$ edge compute create \

--image ubuntu-24-04 --plan small \

--script ./bootstrap-svelte.sh

# CDN out front

$ edge cdn create app.example.com \

--origin https://<vm-ip>

Why SvelteKit teams pick Edge

Tiny apps, real CPU, predictable bills.

adapter-node, no fuss

Build with adapter-node and run the resulting Node bundle on any Edge VM. Tiny RAM footprint, plain Linux, no platform-specific build.

Real CPU, no cold starts

Long-running Node process on a real VM means consistent response times — no serverless cold start to worry about on every request.

Vite + edge image optimisation

Use SvelteKit's `enhanced:img` for build-time work, then point public images at Edge Image Optimization for on-the-fly transforms.

S3-compatible storage

Use any AWS-SDK-compatible client to push uploads and downloads through Edge Storage. Works the same in dev and prod.

Global CDN, zero egress

Cache static assets and edge-cacheable routes globally with no egress fees. Your VM only sees the dynamic traffic that needs it.

Push from your CI

GitHub Actions, GitLab CI or a single SSH command. The Edge CLI is fully scriptable end-to-end.

Reference architecture

How SvelteKit maps to Edge

Adapter-node + VM + CDN. Boring on purpose.

Compute

Runs `node build/index.js` from your adapter-node output

Storage

S3-compatible bucket for uploads, downloads and overflow assets

CDN

Caches `_app/`, public/ and any cacheable load functions

Image Optimization

Resize, crop and AVIF/WebP transforms via URL

DNS

Anycast DNS for production, staging and previews

# /etc/systemd/system/svelte.service

[Service]

WorkingDirectory=/srv/app

ExecStart=/usr/bin/node build/index.js

Restart=always

Environment=PORT=3000

Environment=NODE_ENV=production

[Install]

WantedBy=multi-user.target

Common questions

Which adapter should I use?

adapter-node. It produces a self-contained Node app that runs anywhere Node runs — including Edge VMs. We recommend it over the platform-specific adapters precisely because it keeps you portable.

How do I run it as a service?

Wrap `node build/index.js` in a systemd unit on the VM. Bootstrap script handles install, build and service registration on first boot.

Server-only modules and form actions?

Both work exactly as documented. SvelteKit runs as a normal Node process, so anything in the SvelteKit docs Just Works.

How do I do previews per PR?

Spin up an ephemeral VM in CI, alias a `*.test.network` subdomain to it, tear it down on PR close. The Edge CLI makes this trivial.

By Stack

Other stacks on Edge

View all stacks →

Ship SvelteKit on Edge

30-day trial. Bring your repo, deploy in minutes.