Deploy a site
Put a React or Next.js app on a box with its own HTTPS address, in one command.
In the directory of a React app (Vite or Create React App) or a Next.js app:
kvbox deployThe first time it asks four things, each with a default you can just accept:
? Template React detected from package.json
? Box name my-site the directory's name
? Address my-site https://my-site.kvbox.app
? Box size xs 1 vCPU, 2 GB RAM, 8 GB diskThen it builds the app on your machine with the project's own build script, boots a box, ships the build output into it and claims the address:
✓ my-site is live at https://my-site.kvbox.app
box my-site (new) · React · 14 files, 1.2 MBThe answers are saved to kvbox.json next to package.json, so the next kvbox deploy asks nothing: it builds, ships and reloads, the same box and the same URL, in a few seconds. Commit the file; a teammate or an agent then deploys with the same settings.
{ "template": "react", "name": "my-site", "subdomain": "my-site", "size": "xs", "dist": "dist" }A flag changes one field and is saved: kvbox deploy --sub other-name. Scripts and agents skip the questions with -y (the defaults) or the flags, and read the result with --json (dist is in it only for a React app). The box is yours, or an org's with --org acme (saved too).
On a host's own socket (no kvbox login, or --local) there is no HTTPS address: the command asks three things, not four, and prints http://<box ip>, reachable from that host only.
What is in the box
React. The build output (dist/, or build/ for Create React App) lands in /srv/app/dist, and nginx, which comes with the image, serves it on port 80 with single-page-app routing: an unknown path answers index.html. The address points at port 80. A failed build deploys nothing; a redeploy stages the new files and swaps the directory in one move, keeping the old site until the new one is in place, so visitors never see a half-copied site.
Next.js. Nothing is built on your machine: the source is shipped (without node_modules, .next and .git, so .env files go along) and the box installs, builds and runs it with your package manager (npm, pnpm or yarn, told by the lockfile; a bun project installs with npm). The app lives in /srv/app/current and runs as the systemd service kvbox-app (npm run start on port 3000, restarted if it dies, back after a reboot); the address points at port 3000. The box is s by default, since next build wants memory. A redeploy installs and builds in a staging directory while the old app keeps serving, then swaps and restarts: a failed build changes nothing, and the deploy takes a minute or two instead of seconds. kvbox connect lands in a box with the whole project; journalctl -u kvbox-app has the app's log.
Either way it is an ordinary box, made to hibernate after an hour without traffic (kvbox vm set my-site --auto-hibernate off to change that). kvbox connect my-site opens a shell in it, kvbox stop and kvbox rm apply, and a hibernated box wakes when someone visits. Boxes made before base image v0.8.0 cannot take a deploy: kvbox vm update <box> once the host has the new image, or deploy under another name to get a fresh box.