Deploy a static SvelteKit site to your own VPS

Deploy a SvelteKit site built with adapter-static to your own VPS: ox reads the pages folder from svelte.config and Caddy serves it over HTTPS, no Docker.

Last updated 2026-10-09

On this page

To deploy a static SvelteKit site to a VPS with ox, add the repo as a project and deploy it, with no Dockerfile and no ox.toml. ox reads svelte.config.ts and package.json, runs npm install and npm run build, and Caddy serves site over HTTPS with no app process. Run ox check in your repo to see the same plan before the first deploy.

Plan verified, real-server test pending. The plan below is what ox check prints for a minimal SvelteKit static repo in ox's tests. A deploy on a real server is not recorded yet.

ox reads svelte.config.ts and package.json, builds the plan on the card, and serves site as files on your server.

What ox detects in a SvelteKit static repo

This is the plan ox check prints for a minimal a SvelteKit site with adapter-static, with no ox.toml. Each row says where its value came from: a file in the repo, or ox's default.

FieldValueSource
static.dirsitedetected:svelte.config.ts
build.installnpm installdetected:package.json
build.commands[0]npm run builddetected:package.json
tools.node24default

ox check also prints these hints for it:

  • svelte.config.ts sets fallback: '200.html', and ox's spa mode serves index.html for unknown paths; set fallback: 'index.html' and [static] spa = true for a single-page app

The ox.toml for SvelteKit static

None is needed: the plan above comes from the repo alone. Write one to serve your own domain or to change what ox detected. This one passes ox check against the same repo: [static] needs its dir, and the build stays detected.

ox.toml, optional
domains = ["www.example.com"]

[static]
dir = "site"

Check and deploy SvelteKit static

Add the repo as a project, then check and ship it from a terminal:

Check, deploy and read the logs
ox check                                # in the repo: the plan above, offline
ox new <owner/repo> --server <server>  # add the repo as a project
ox deploy <project> --wait              # stream the deploy, exit with its result
ox runs <project>                      # past deploys, with their ids
ox logs <project> --run <id>         # one deploy's log

A static site has no app process, so its log is the deploy's own: ox runs lists them and --run reads one.

Variables to set for SvelteKit static

None before the first deploy: ox check asks for no variable. Add your own on the dashboard's Variables tab or with ox vars set <project> KEY.

ox provides these to the app itself: PORT, HOST, OX_ENV, OX_PROJECT, OX_RELEASE, OX_DATA_DIR, PUBLIC_URL and PUBLIC_HOST.

If the SvelteKit static deploy fails

  • svelte.config.js uses @sveltejs/adapter-auto, which builds for another host; install @sveltejs/adapter-node (a server) or @sveltejs/adapter-static (a static site) and use it in svelte.config.js: adapter-auto is the SvelteKit default and builds for other hosts. Switch to adapter-node or adapter-static. More.
  • build 1/1: npm run build: exit status 1: Your build failed. The lines above it are the build's own output; run the same command on your computer, fix it, and push. More.
  • the build left no dist directory: The build wrote its files somewhere else. Set [static] dir to the folder your build makes. More.

Your visitors never see a failed deploy: the previous release keeps serving until the new one passes its health check.

Next steps

SvelteKit static FAQ

Do I need a Dockerfile or an ox.toml to deploy a static SvelteKit site to a VPS?

No. ox does not use Docker, and ox check on a SvelteKit static repo with no ox.toml prints Ready to deploy. Write an ox.toml only to change what ox detected.

What does ox install on the server for SvelteKit static?

Only what the plan names: node 24 (ox's default). Your app's own dependencies are installed by the build into the release folder, not system-wide.

How do I make it a single-page app?

Set fallback: 'index.html' in the adapter's options and [static] spa = true in an ox.toml, as the hint above says. Caddy then sends unknown paths to index.html.

Every stack ox deploys, and the ones it does not yet, is on the Stacks page.