Deploy
Crax builds to a static dist/ directory. No server runtime required. Deploy to any static host, CDN, or container.
Static Hosting
The simplest option. Upload dist/ to any static host.
Output works on Vercel, Netlify, Cloudflare Pages, GitHub Pages, S3, or any file server. No framework-specific adapter needed.
Docker + Caddy
Crax projects include a Dockerfile and Caddyfile by default.
Dockerfile:
Caddyfile:
Build and run:
The container serves the production build via Caddy with gzip compression and SPA fallback routing.
Caddy Without Docker
If Caddy is installed locally:
The try_files directive handles client-side routing by falling back to index.html for any path that does not match a static file.
Other Options
Any static file server works. Common choices:
- Nginx: Use
try_files $uri $uri/ /index.html;for SPA fallback - Apache: Use
mod_rewritewithFallbackResource /index.html - Cloudflare Pages: Auto-detected, zero config
- Vercel / Netlify: Auto-detected, zero config
