kvbox.sh
Deploy

React

Deploy a Vite or Create React App site: built on your machine, served by nginx with single-page-app routing.

A React app made with Vite or Create React App deploys as static files:

cd my-site
kvbox deploy
# ✓ my-site is live at https://my-site.kvbox.app

What happens

  1. The app is built on your machine with the project's own build script. A failed build deploys nothing.
  2. The build output (dist/, or build/ for Create React App) is shipped into the box. The folder is saved to kvbox.json as dist.
  3. nginx, which comes with the image, serves it from /srv/app/dist on port 80, where the address points.

A redeploy stages the new files and swaps the directory in one move, keeping the old site until the new one is in place: visitors never see a half-copied site. It takes a few seconds.

Routing

nginx answers index.html for a path that is not a file, so client-side routing (React Router, TanStack Router) works on a refresh or a deep link.

Environment variables

The app is built on your machine, so build-time variables (VITE_*, REACT_APP_*) come from your machine's environment and .env files, as with any static build. kvbox env variables reach the box, not the files nginx serves.

Defaults

The box is xs (1 vCPU, 2 GB of RAM), plenty for static files; --size s when you make it if you want more. It hibernates after an hour without visitors and wakes on the next one.

On this page