General build settings
The output directory depends on the adapter used in vite.config.ts (or svelte.config.js). Do not assume build/ — check which adapter is installed:
| Adapter | Output directory |
|---|---|
@sveltejs/adapter-auto |
Host-dependent (Vercel → .vercel/output, Netlify → .netlify/, Cloudflare → .svelte-kit/cloudflare) |
@sveltejs/adapter-cloudflare |
.svelte-kit/cloudflare |
@sveltejs/adapter-vercel |
.vercel/output |
@sveltejs/adapter-static |
build (default) |
@sveltejs/adapter-node |
build (Node server, not static) |
Common settings for most hosts:
- Build command:
npm run build - Output directory: see table above (match your adapter)
- Node.js version: 22.17 or newer (required by
@sveltejs/kit3.x). SetNODE_VERSION=22.17.0(or higher) in the host's environment variables, or add a.nvmrc/.node-versionfile with22.17.0at the repo root.
⚠️ If the build fails with
EBADENGINE/Unsupported enginefor@sveltejs/kit, your host is running an older Node version. Upgrade Node as described above.
Vercel
- Import the repository in Vercel.
- Framework preset: SvelteKit.
- Build command:
npm run build. - Output directory: leave default. Vercel detects SvelteKit via
adapter-auto/adapter-vercel. - Deploy.
Custom domain: Settings → Domains → add domain → follow DNS instructions.
Decap CMS note: Vercel does not provide Git Gateway. Use a GitHub OAuth backend or run Decap with a different backend.
Cloudflare Pages
Cloudflare Pages is a solid choice for static or SSR SvelteKit sites. The setup is slightly different from Netlify because Cloudflare does not have built-in Git Gateway, and the build output directory is not build/.
Step 1: Install the Cloudflare adapter
npm i -D @sveltejs/adapter-cloudflare
Step 2: Update your SvelteKit config
In vite.config.ts (or svelte.config.js), replace adapter-auto with:
import adapter from '@sveltejs/adapter-cloudflare';
// ...
adapter: adapter()
The Cloudflare adapter supports all SvelteKit features and builds to .svelte-kit/cloudflare .
Step 3: Connect the repository in Cloudflare
- Go to the Cloudflare dashboard → Workers & Pages → Create application → Pages → Import an existing Git repository.
- Select your repository and click Begin setup.
- In the Build settings section, select SvelteKit as the Framework preset. Cloudflare will auto-fill:
- Build command:
npm run build - Build directory:
.svelte-kit/cloudflare
- Build command:
- (Important) Set the Node.js version. Cloudflare's default Node may be older than what SvelteKit 3.x requires. Add an environment variable
NODE_VERSIONwith value22.17.0(or higher) in the Cloudflare Pages project settings . - Click Save and Deploy.
Cloudflare will install dependencies, run the build, and deploy your site. Every push to your connected branch triggers a new deploy, and pull requests get preview deployments automatically .
Custom domain
In your Cloudflare Pages project, go to Custom domains → add your domain → follow the DNS instructions.
Decap CMS note (important)
Cloudflare Pages does not provide Netlify Identity or Git Gateway. To run Decap CMS on Cloudflare, you must use a GitHub OAuth backend. This requires:
- Creating a GitHub OAuth App.
- Deploying a small OAuth proxy (either as a Cloudflare Function or a separate Worker) to handle the callback .
- Configuring Decap CMS
config.ymlwithbackend: name: githuband the proxy URL.
This is significantly more setup than Netlify's Git Gateway. If you only need Decap CMS, Netlify remains the simpler path.
AWS (S3 + CloudFront)
AWS S3 + CloudFront serves static files. Use @sveltejs/adapter-static:
Install the static adapter:
npm i -D @sveltejs/adapter-staticConfigure it in
vite.config.ts/svelte.config.js:import adapter from '@sveltejs/adapter-static'; // ... adapter: adapter({ fallback: '404.html' })Build the project locally:
npm run buildUpload the
build/folder to an S3 bucket configured for static hosting.Create a CloudFront distribution pointing at the bucket.
Set the default root object to
index.html.Add error document
404.htmlfor SPA fallback if needed.
Custom domain: use Route 53 or your DNS provider, then attach an ACM certificate to CloudFront.
Decap CMS note: static S3 hosting cannot run Git Gateway. Use GitHub OAuth with a small auth service, or edit locally and push.
cPanel
cPanel is static hosting. Use @sveltejs/adapter-static:
Install and configure
@sveltejs/adapter-static(see AWS section).Build locally:
npm run buildZip the contents of
build/.In cPanel File Manager, upload the zip to
public_html.Extract it.
Make sure
index.htmlis at the root ofpublic_html.
Custom domain: cPanel handles domains through Domains or Addon Domains. Point DNS to the hosting provider.
Decap CMS note: cPanel is static hosting. Same limitation as S3. Use GitHub OAuth or edit locally.
Custom domain checklist
For any host:
- Add the domain in the host dashboard.
- Point DNS to the host.
- Enable HTTPS.
- Update
site.jsonwith the newurl. - Rebuild and redeploy.
What to check after deploy
- Home page loads.
/servicesloads and pagination works./blogloads, filters work, pagination works./admin/loads if Decap CMS is configured.- Meta tags are present in page source.
- Images load from
/images/blog/or the Unsplash URLs.
Next step
You are done with the docs. If something breaks, check the browser console and the host build logs first.