Skip to content

Deploy SvelteKit

deploybase supports SvelteKit with adapter-static for fully static output. Server-side rendering and form actions that require a Node.js runtime are not supported.

  • SvelteKit 2+
  • @sveltejs/adapter-static installed
Terminal window
npm install -D @sveltejs/adapter-static
import adapter from '@sveltejs/adapter-static';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter({
pages: 'build',
assets: 'build',
fallback: undefined,
precompress: false,
strict: true,
}),
},
};
export default config;
SettingValue
Frameworksveltekit
Build commandnpm run build
Output directorybuild
Docker imagenode:24-alpine
Terminal window
curl -X POST https://api.deploybase.eu/api/v1/projects \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My SvelteKit Site",
"framework": "sveltekit",
"git_repo_url": "https://github.com/user/sveltekit-site.git",
"git_provider": "github"
}'

Build fails with “adapter-static requires prerender” — All routes must be prerenderable. Add to src/routes/+layout.js:

export const prerender = true;

Or set strict: false in the adapter config to skip non-prerenderable routes (they will 404 instead of failing the build).

Using Bun instead of npm — The build image (node:24-alpine) does not include Bun. To use Bun, install it as part of the build command:

Terminal window
curl -X PATCH https://api.deploybase.eu/api/v1/projects/PROJECT_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"build_command": "npx bun install && npx bun run build"}'