kvbox.sh
Deploy

Overview

Put a React app, a Next.js app or a Node server on a box with its own HTTPS address, in one command.

In the directory of a React app, a Next.js app or a Node server:

kvbox deploy

The 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 disk

A Next.js app or a Node server is also asked its port (default 3000), the one it listens on.

Then it boots a box, puts your app in it and claims the address:

✓ my-site is live at https://my-site.kvbox.app
  box my-site (new) · React · 14 files, 1.2 MB

What it supports

TemplateDetected fromBuiltServed byDefault size
ReactVite or Create React Appon your machinenginx, port 80xs
Next.jsnextin the boxits start script, port 3000 or yourss
Node APIExpress, Fastify, Koa, NestJS, Honoin the boxits start script, port 3000 or yoursxs

The template is detected from package.json; --template picks one by hand (--template node for a Node server on any other framework).

Redeploys

The answers are saved to kvbox.json next to package.json, so the next kvbox deploy asks nothing: it ships the new version to the same box, at the same URL. 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 redeploy never leaves a half-updated app: the new version is staged next to the old one, which keeps serving until the swap. A failed build changes nothing.

Flags, scripts and agents

A flag changes one field and is saved: kvbox deploy --sub other-name.

FlagWhat it sets
-t, --templatereact, nextjs or node
-n, --namethe box's name
--subthe address, https://<sub>.kvbox.app
-s, --sizethe box's size, when it has to be made
--portthe port a Next.js app or Node server listens on (default 3000)
--orgdeploy into an org's boxes

Scripts and agents skip the questions with -y (the defaults) or the flags, and read the result with --json. The preview environments page has a GitHub Actions workflow that deploys every pull request.

The box

It is an ordinary box. kvbox connect my-site opens a shell in it; kvbox stop, kvbox rm and the rest apply. It hibernates after an hour without traffic, and a visit wakes it in a few seconds; kvbox vm set my-site --auto-hibernate off keeps it running. Your variables reach a Next.js app or a Node server, and a custom domain can point at the box next to its kvbox.app address.

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.

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.

On this page