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.
Requirements
Section titled “Requirements”- SvelteKit 2+
@sveltejs/adapter-staticinstalled
Configuration
Section titled “Configuration”Install adapter-static
Section titled “Install adapter-static”npm install -D @sveltejs/adapter-staticsvelte.config.js
Section titled “svelte.config.js”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;deploybase Defaults
Section titled “deploybase Defaults”| Setting | Value |
|---|---|
| Framework | sveltekit |
| Build command | npm run build |
| Output directory | build |
| Docker image | node:24-alpine |
Create and Deploy
Section titled “Create and Deploy”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" }'Common Issues
Section titled “Common Issues”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:
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"}'