Deploy guide

How to deploy SvelteKit

SvelteKit builds your site to a folder of plain files. Here's how to build it, which folder to publish, and the setup on each host.

npm run buildbuild

Pick a host

Where do you want it?

Before any host

Build it

Install the static adapter (npm i -D @sveltejs/adapter-static), use it in your config, and add export const prerender = true; to src/routes/+layout.js so every page is built to a file.

vite.config.js
import adapter from '@sveltejs/adapter-static';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [
    sveltekit({
      adapter: adapter(),
    }),
  ],
});

Run npm run build. The site comes out in build: that folder is what goes online, whichever host you pick.

Good to know

Worth knowing first

  • SvelteKit 2 keeps the adapter in svelte.config.js under kit.adapter; SvelteKit 3 moved it into the sveltekit() plugin in vite.config.js, as shown here. The options are the same.

Or skip the setup

Drop it in. It's online in seconds.

A file, a folder or a whole site: 99helpers puts it online at its own address, with no git, no build settings and no DNS to start with. Add your own domain whenever you're ready.