Deploy

Deploy to Other Hosts

Deploy the SvelteKit build to Vercel, Cloudflare Pages, AWS, or cPanel, with notes on Decap CMS.

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/kit 3.x). Set NODE_VERSION=22.17.0 (or higher) in the host's environment variables, or add a .nvmrc / .node-version file with 22.17.0 at the repo root.

⚠️ If the build fails with EBADENGINE / Unsupported engine for @sveltejs/kit, your host is running an older Node version. Upgrade Node as described above.

Vercel

  1. Import the repository in Vercel.
  2. Framework preset: SvelteKit.
  3. Build command: npm run build.
  4. Output directory: leave default. Vercel detects SvelteKit via adapter-auto / adapter-vercel.
  5. 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

  1. Go to the Cloudflare dashboard → Workers & Pages → Create application → Pages → Import an existing Git repository.
  2. Select your repository and click Begin setup.
  3. 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
  4. (Important) Set the Node.js version. Cloudflare's default Node may be older than what SvelteKit 3.x requires. Add an environment variable NODE_VERSION with value 22.17.0 (or higher) in the Cloudflare Pages project settings .
  5. 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:

  1. Creating a GitHub OAuth App.
  2. Deploying a small OAuth proxy (either as a Cloudflare Function or a separate Worker) to handle the callback .
  3. Configuring Decap CMS config.yml with backend: name: github and 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:

  1. Install the static adapter:

    npm i -D @sveltejs/adapter-static
    
  2. Configure it in vite.config.ts / svelte.config.js:

    import adapter from '@sveltejs/adapter-static';
    // ...
    adapter: adapter({ fallback: '404.html' })
    
  3. Build the project locally:

    npm run build
    
  4. Upload the build/ folder to an S3 bucket configured for static hosting.

  5. Create a CloudFront distribution pointing at the bucket.

  6. Set the default root object to index.html.

  7. Add error document 404.html for 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:

  1. Install and configure @sveltejs/adapter-static (see AWS section).

  2. Build locally:

    npm run build
    
  3. Zip the contents of build/.

  4. In cPanel File Manager, upload the zip to public_html.

  5. Extract it.

  6. Make sure index.html is at the root of public_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:

  1. Add the domain in the host dashboard.
  2. Point DNS to the host.
  3. Enable HTTPS.
  4. Update site.json with the new url.
  5. Rebuild and redeploy.

What to check after deploy

  • Home page loads.
  • /services loads and pagination works.
  • /blog loads, 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.