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
| Feature | How Temps handles it |
|---|---|
| Build | npm run build |
| Output | Serves dist/ (Vite) or build/ (CRA) |
| HTTPS | Let's Encrypt certificate, auto-renewed |
| Client-side routing | 404 → index.html fallback configured automatically |
| Cache headers | Hashed assets get long-lived cache headers |
| Compression | gzip and brotli enabled |
| Preview deployments | Every 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.