Deploy React on Your Own Server

Deploy static React applications built with Vite or Create React App. Temps builds your app and serves the output with a fast web server.


Quickstart

From your project root, deploy with your preferred package manager:

npx @temps-sdk/cli up

Temps auto-detects Vite and CRA, runs npm run build, and serves the dist/ or build/ output. Your app is live with HTTPS in about 2 minutes.


What Temps Handles Automatically

FeatureHow Temps handles it
Buildnpm run build
OutputServes dist/ (Vite) or build/ (CRA)
HTTPSLet's Encrypt certificate, auto-renewed
Client-side routing404 → index.html fallback configured automatically
Cache headersHashed assets get long-lived cache headers
Compressiongzip and brotli enabled
Preview deploymentsEvery PR gets its own URL

Environment Variables

Vite environment variables (prefixed VITE_) are embedded at build time:

bunx @temps-sdk/cli environments vars set VITE_API_URL "https://api.example.com" -e production

A new deployment is triggered when you update build-time variables.


Backend API

If your React app calls a backend API, deploy your backend as a separate Temps project and set VITE_API_URL to its URL. For full-stack apps in a monorepo, see the Monorepos guide.


Next Steps

Was this page helpful?