DockHosting Docs
Deploying

Static sites

Deploy a static HTML, CSS, and JS site on DockHosting.

For a site with no server-side process — plain HTML, or the built output of Vite, Astro, or a similar static-site tool — DockHosting serves your files directly rather than running a Node process to generate each response.

Requirements

  • A build output directory containing an index.html (commonly dist/, build/, or public/, depending on your tool — configurable in your project's settings)
  • If your framework has a build step (Vite, Astro, Create React App), a build script in package.json that produces that output directory

What DockHosting does

The build step runs if one is configured, then the resulting static files are served directly over HTTPS on your free subdomain — no runtime process, no port to bind, none of the environment-variable considerations that apply to a server-rendered app.

Client-side routing

A single-page app using client-side routing (React Router, Vue Router in history mode) needs every path to fall back to index.html so deep links and refreshes work — this is the default behavior for static hosting on DockHosting, so a client-side route like /dashboard/settings resolves correctly even on a hard refresh.

Environment variables at build time

Static sites bake configuration in at build time, not runtime — there's no running process to read process.env from after the fact. Set build-time variables in your project's settings the same way as any other project; your build tool (Vite's import.meta.env, Create React App's process.env.REACT_APP_*) picks them up during the build step, and they're compiled into the output files.

Need a backend too?

A static frontend and an API are two separate projects on DockHosting, not one — deploy your backend (see Node.js, Laravel, or any other supported stack) as its own project and point your static site at its URL.

On this page