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.
Prerequisites
Section titled “Prerequisites”- 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
buildscript and nostartscript; - plain HTML with
index.html(orpublic/index.html) in the repository root.
- a Vite (React, Vue, Svelte, Solid, …), Create React App or Astro project with a
Deploy
Section titled “Deploy”- + Create → Git repository, pick the repository.
- Choose the Static site preset. The runtime is Static.
- Pick servers and a domain, then Deploy.
What gets published
Section titled “What gets published”| 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.
Build-time variables
Section titled “Build-time variables”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.
VITE_API_URL=https://api.example.comPUBLIC_PLAUSIBLE_DOMAIN=example.comHow requests are served
Section titled “How requests are served”For every request Caddy tries, in order:
- the exact file, or the directory’s
index.html; /404.htmlwith status 404, if your site has one;/index.htmlfor paths without a file extension, so client-side routes like/dashboard/settingssurvive a reload (SPA fallback);- 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
Section titled “Deploy script”$FALAK_FETCH
$FALAK_ACTIVATEReleases 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.