Skip to main content
PercherPercher

Deploy guide · runtime = "docker"

Deploy Preact on Percher

Preact is a ~3 kB React-compatible alternative with the same JSX, hooks, and component API. On Vite it ships exactly like Vite + React but with a much smaller runtime in the final bundle.

Why Percher fits

  • Tiny runtime + slim Caddy image means the served bundle is often under 50 kB total — fast first paint, no cold-start delay.
  • Standard `VITE_*` env-var auto-forwarding works identically to React; same migration path.

Quick start

bunx percher create my-app --template preact
cd my-app
bunx percher publish

The first command scaffolds a working Preact project plus a `percher.toml`. Publish builds and deploys it; the live URL prints on completion.

percher.toml

The canonical config for a Preact app on Percher. `bunx percher init` generates this automatically when it detects Preact in your project.

[app]
name = "my-app"
runtime = "docker"
framework = "preact"

[web]
port = 8080
health = "/"

Common gotchas

  • `preact/compat` aliases `react` and `react-dom` if you're porting code that imports React directly — set up the alias in `vite.config.ts`.
  • Bundle size advantage is preserved only if you don't pull in heavy React-only libraries. Watch the build output.

Related docs

Ready to deploy Preact?

Free plan, no credit card. Live in under a minute.

Sign up free

← Browse all deploy guides