kvbox.cloud
Deploy

Overview

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

In the directory of a React app, a Next.js app, a Node server, a project with a Dockerfile or a plain static site:

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, a Node server or a container is also asked its port (default 3000), the one the address points at.

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
Dockera Dockerfilein the boxthe container, port 3000 or yourss
Static sitean index.html and nothing to buildnot at allnginx, port 80xs

The template is detected from package.json and the directory; --template picks one by hand (--template node for a Node server on any other framework, --template static for a site a tool builds into a folder). A project that fits two, a Next.js app with a Dockerfile say, deploys with Docker: the Dockerfile was written to be deployed. The question shows the other match on a terminal; with -y a line says which was taken and how to pick the other (--template nextjs).

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, --templatedocker, react, nextjs, node or static
-n, --namethe box's name
--subthe address, https://<sub>.kvbox.app
-s, --sizethe box's size, when it has to be made
--portthe box port of a Next.js app, Node server or container (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 (not a container yet), 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