Deploying
Deploy a static site or React, Vue or Angular app
Host a static site or a React, Vue, Angular, Vite, Gatsby or Astro front-end on DployHub with gzip, HTTPS and SPA fallback for client-side routes.
Updated 3 min read
DployHub serves static sites and single-page apps with a fast web server on port 80, gzip compression and HTTPS. Plain HTML sites are served as they are; front-end projects are built first and then served from their output folder. Unknown paths fall back to /index.html, so client-side routing works without extra setup.
Plain HTML sites
If the root folder has an index.html and no Dockerfile, package.json or Python files, we serve the folder as-is. No build step runs. This suits hand-written sites, documentation exports and anything generated before you push.
Front-end frameworks
A package.json with a build script but no server framework is detected as a static front-end. We install dependencies, run the build and serve the output folder:
- Create React App (
react-scripts):build. - Vite with React, Vue or Svelte:
dist. - Vue CLI (
@vue/cli-service):dist. - Angular: the
outputPathfromangular.json, plus/browserfor the application builder. - Gatsby:
public. - Astro:
dist.
A typical Vite project needs nothing special:
{
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"vite": "5.4.2"
}
}Client-side routing
Requests for paths that do not match a file are answered with /index.html. That means a direct visit or refresh on /dashboard/settings loads your app and lets React Router, Vue Router or the Angular router take over. You do not need redirect files.
Keep secrets out of the bundle
Everything in a front-end bundle is downloaded by every visitor, so never put API secrets in your front-end code or in files like .env.production that your build includes. Public values such as an API base URL are fine; secret keys belong in a back-end app, where they can live in environment variables.
Resources and cost
Static sites need very little. The smallest size, 0.25 vCPU with 256 MB memory and 1 GB storage, costs ₹118.50 a month and handles most marketing sites and SPAs. Staging is free. See Resources to size it up later.
Troubleshooting
- Blank page: check that asset paths are relative to the site root, and that the build produced the folder listed above.
- Wrong folder served: choose Static website and check the build command, or use your own Dockerfile.
- Build failed: read the build log in the Deployments tab, then see Build failed.
Quick guides: /deploy/react, /deploy/vue and /deploy/static-site. If something still looks wrong, raise a ticket.
Frequently asked questions
Does client-side routing work after a refresh?
Yes. Unknown paths fall back to /index.html, so routes like /dashboard load your app.
Is gzip compression enabled?
Yes. Static sites are served with gzip on port 80 behind automatic HTTPS.
What is the cheapest size for a static site?
0.25 vCPU, 256 MB memory and 1 GB storage at ₹118.50 a month, plus GST.
Related articles
- Deploy a Node.js app (Express, Fastify, NestJS)How DployHub detects and deploys Node.js apps: package manager, build and start commands, port detection and the settings you can override.
- Build settings: build, start, root folder and moreEvery DployHub build setting explained: build type, build and start commands, port, root folder, Dockerfile path and health check path, with examples.
- Add a custom domain with free automatic HTTPSPoint your own domain at a DployHub app with a CNAME record. HTTPS certificates are issued and renewed automatically, with HTTP redirected to HTTPS.
- Choose vCPU, memory and storage for your appPick vCPU, memory and storage for your live environment, see the monthly price before you commit, and change resources later with a quick restart.