Your React single-page app, built and served for you
A React project built with Vite or Create React App has no server of its own, so DployHub builds it and serves the output as a static site with Caddy. We detect vite or react-scripts, run your build script and serve dist or build with gzip. Unknown paths fall back to index.html, so React Router routes load on refresh.
Free staging (0.25 vCPU · 256 MB · 1 GB) · Live from ₹118.50/month, billed hourly · No servers to manage
Sensible React defaults, no config files.
When you connect the repository we read it and fill in the build settings below. Every value can be changed in the app’s settings — see build settings.
- Runtime
- Static site (Caddy)
- Port
- 80
- Build command
- npm run build
- Start command
- Served as static files (no start command)
Deploy React in minutes.
- 1
Confirm the build script
Vite:
"build": "vite build"outputs todist. Create React App:"build": "react-scripts build"outputs tobuild. Both are picked up automatically. - 2
Point the app at your API
Set
VITE_API_URL(Vite) orREACT_APP_API_URL(CRA) in the Environment variables tab. These are compiled into the bundle during the build. - 3
Create the app
In New app choose your repo and branch. Detection selects a static site because there is no server framework in
package.json. - 4
Check staging
Open the staging URL, click into a nested route and hit refresh. The SPA fallback serves
index.html, so the router takes over. - 5
Go live on your domain
Click Go live, then add
www.yourdomain.comin the Domains tab. Use the smallest live size; static files need very little.
Running React well in production.
Staging is free
Every app gets a staging copy in a free, lightweight Docker container (0.25 vCPU · 256 MB · 1 GB). It pauses after 7 days without a deploy — one click starts it again.
VITE_andREACT_APP_values are frozen into the JavaScript at build time and Go live reuses the staging build. Keep them the same on staging and live, and redeploy after any change.- Never put secrets in
VITE_orREACT_APP_variables: anyone can read them in the browser. Keep secrets in your API. - If you add
expressor another server framework topackage.json, detection switches to a Node server. Remove it, or set How to build it to Static website, if you only want static hosting. - With Vite, leave
baseas/unless you deliberately serve from a sub-path; a wrongbasegives a blank page with 404s for the assets. - A static React site barely uses CPU. Live at 0.25 vCPU, 256 MB and 1 GB costs ₹118.50 a month, and staging is free.
Trigger
git push
Promote
same image
Rollback
1 click
React questions.
Do I need a 404.html or _redirects file for React Router?
No. Any path that is not a real file is answered with `/index.html`, so `BrowserRouter` deep links work without extra config.
Is gzip enabled?
Yes. Static sites are served with gzip compression on port 80, behind automatic HTTPS.
What about Next.js or Remix?
Those are server frameworks, so they deploy as Node apps instead. See [Deploy a Next.js app](/deploy/nextjs).
Can I deploy a React app inside a monorepo?
Yes. Set Folder with your app to the package folder, for example `apps/web`, and we detect and build from there.
Ship your React app today.
Create an account, connect your repository and get a free staging copy plus a live HTTPS address in minutes.