Skip to content

Deploy static sites

A static site is built once on the builder and served by Caddy on your servers. There is no process to supervise. Single-page apps work out of the box.

  • A server of type app or web (any server that serves HTTP).
  • One of:
    • a Vite (React, Vue, Svelte, Solid, …), Create React App or Astro project with a build script and no start script;
    • plain HTML with index.html (or public/index.html) in the repository root.
  1. + Create → Git repository, pick the repository.
  2. Choose the Static site preset. The runtime is Static.
  3. Pick servers and a domain, then Deploy.
Project Detected output directory
Vite (React, Vue, Svelte, …) dist
Create React App build
Astro (without @astrojs/node) dist
index.html in the root the repository root
public/index.html public
Other frameworks with the Static preset the first of dist, build, out, public that exists in the repository before the build

The builder installs dependencies, runs npm run build (or the pnpm, yarn or bun equivalent) with NODE_ENV=production, and packages only the output directory.

Only variables with a public prefix reach the build: VITE_, NEXT_PUBLIC_, NUXT_PUBLIC_, PUBLIC_, REACT_APP_. Expose any other variable to the deploy script to make it available to the build (for example Astro’s SITE_URL). See Builds.

Site variables
VITE_API_URL=https://api.example.com
PUBLIC_PLAUSIBLE_DOMAIN=example.com

For every request Caddy tries, in order:

  1. the exact file, or the directory’s index.html;
  2. /404.html with status 404, if your site has one;
  3. /index.html for paths without a file extension, so client-side routes like /dashboard/settings survive a reload (SPA fallback);
  4. otherwise a 404.

A missing asset like /assets/app.js stays a 404 instead of returning your HTML. .env and .git are never served.

Add headers, redirects, basic auth or IP rules under Settings → Networking. See Routing rules.

Deploy script (Static preset)
$FALAK_FETCH
$FALAK_ACTIVATE

Releases switch atomically. Static sites have no restart phase, and the preset sets no health check path; add one under Settings → Deploy if you want Falak to verify each release.