kvbox.cloud
Self-host

Install a server

Turn a Linux machine with KVM into a kvbox host.

A host is a Linux machine with KVM that runs kvbox-server: it owns Firecracker, the boxes and their networking, and serves the API the CLI uses. Node 22.13 or newer must be present.

curl -fsSL https://kvbox.cloud/install-server.sh | bash

It installs a pinned Firecracker, the guest kernel, the base image, the SSH key kvbox connect uses, both npm packages (@kvbox/cli and @kvbox/server), and adds you to the kvm group; it asks for sudo only where root is needed (the bridge, NAT and firewall rules). Rerun it any time, it only changes what is missing, and it is how a host is upgraded. KVBOX_YES=1 takes every default.

install-server.sh --update updates a host that is already set up: Firecracker, both npm packages, the images and the kernel, then it restarts kvbox-server (running boxes keep running). It never asks for sudo; when a release changes something only root may touch (the network script, the systemd unit) it says so, and a plain rerun from a terminal does the rest. On a host joined to a control plane, an admin starts it over the API with POST /admin/hosts/<name>/update; GET /admin/hosts/<name>/info shows the host's versions, its relay and how the last update ended. GET /admin/images gives the latest released version of each image, to hold against what GET /admin/hosts says each host has installed (capacity.images); the web app's Hosts tab marks the ones behind.

After the first install, log in again (or newgrp kvm) so the group change applies before the first kvbox new.

The server

The kvbox CLI is for using boxes; the host's daemon is managed with its own command, kvbox-server, on the host:

kvbox-server status          # running? its control plane, relay, base image, what it brought back at start
kvbox-server logs -f         # the daemon's log (~/.kvbox/server.log), -n 100 for more history
kvbox-server start -d        # start it in the background (through systemd where the installer set it up)
kvbox-server stop            # running boxes are not affected
kvbox-server join|leave|relay|trust-ca|rename-realm   # see the pages that follow

kvbox-server status --json prints the same as an object. kvbox-server start is the daemon itself in the foreground, which is what the systemd unit runs; a plain kvbox-server prints its help.

The installer sets the server up as a systemd service (kvbox-server, running as you), so it starts again after a reboot. At start it boots every box that was running when the host went down; a box that was paused lost its memory with the host and stays stopped, and a hibernated one stays hibernated. kvbox-server status says whether the server starts at boot and what it brought back.

The server listens on a Unix socket under ~/.kvbox, so a host alone is a complete kvbox: nothing listens on the network. On the host the CLI talks to it directly (kvbox --local if you are also logged in to a control plane).

State lives under ~/.kvbox (KVBOX_HOME to move it): boxes as machines/<owner>/<name>, snapshots as snapshots/<owner>/<name>, volumes as volumes/<owner>/<name>, the ledger in kvbox.db. The filesystem is the database; every file there is validated when read.

~/.kvbox must be on an XFS filesystem with reflink (mkfs.xfs -m reflink=1, the default in current xfsprogs). A backup or snapshot then copies a disk as an instant clone. A host on a filesystem that cannot clone (ext4) takes no backups: a backup there is refused, since a full copy would freeze the box for as long as it takes.

Hardware

Boxes want RAM more than anything: a box holds its RAM while running or paused. Rented bare metal with a lot of memory is the natural home for a host. A machine at home behind a router works too, with a relay for a public address.

On this page