Self-hosted deployment
FreeVelox runs entirely on infrastructure you control: a Node process for the console, one Node process per bench for the agents, and a database you choose. This page introduces the shape of an installation, the licence it runs under, the database and schema, the start order, and how to upgrade and restore.
This page covers the in-house installation β the mode in which the console, the socket server and the database run on infrastructure you control. FreeVelox also runs as a hosted console, operated by FreeVelox, where you install only the agents on your benches. The two modes are compared in Deployment modes.
The shape of a self-hosted install
| Application | Directory | Port | Runs where |
|---|---|---|---|
| FreeVelox | apps/console | 3002 | Your server. Serves the UI, the REST API and the Socket.IO endpoint from one process. |
| FreeVelox Agent | apps/agent | 3005 | Every bench or machine that owns hardware. |
The console never dials an agent. Each agent dials the console over HTTP and Socket.IO, so a lab only needs outbound access β no inbound port, port forward or VPN client on the bench. See Network requirements.
The requirements are Node.js 24 or newer, pnpm 11, and a database. The agent additionally needs
bash at /bin/bash for the shell command, and the optional serialport native bindings if the
bench drives a serial port.
The console's REST API answers anything that can reach port 3002. Keep the install on the lab network, or put an authenticating proxy in front of it. See Network requirements.
The console licence
The console's licence is a signed JSON file, not a key string. It records what the install is entitled to run: seats, benches, labs and capabilities.
The operator signs the file, and it is valid for one machine only. The setup wizard's licence step
shows this machine's id (velox_d_<hex>, kept in data/deployment-id); you hand it to the operator, the
operator signs a file bound to that id, and you paste the file back into the wizard. It holds:
{
"payload": {
"licenceId": "lic_9f2cβ¦",
"deploymentId": "velox_d_3a71c0d84f6b4e2a9c5d8e1f7b3a6c90",
"orgId": "org_2b8eβ¦",
"productCode": "inhouse_pro",
"edition": "professional",
"seats": 25,
"agents": 25,
"features": ["bench.connect", "automation.run"],
"version": 3,
"issuedAt": "2026-11-04T10:00:00.000Z",
"expiresAt": "2027-11-04T10:00:00.000Z",
"nonce": "β¦",
"keyId": "k1"
},
"signature": "β¦Ed25519 signature, base64urlβ¦"
}Before it is installed, the file passes the checks one at a time: whether the format is a licence
file, whether keyId names a public key we hold, whether the Ed25519 signature matches, whether the
payload's deploymentId is this machine, and whether the version is older than the highest one this
machine has seen. Expiry is a separate matter β an expired file verifies, and its quota drops
away.
The private key lives on an offline signing machine. Console carries only the public keys
(licensing-keys/<keyId>.pem) and verifies the file where it stands, so a self-hosted install
verifies offline; VELOX_LICENSE_KEYS_DIR points the key directory elsewhere. Whoever reaches the API
server cannot sign a perpetual enterprise licence.
In a self-hosted deployment the quota is inside this file, so it can be computed offline. The catalogue defines these products:
| Product code | Edition | Seats | Benches | Labs |
|---|---|---|---|---|
inhouse_starter | starter | 3 | 3 | 1 |
inhouse_pro | professional | 25 | 25 | 1 |
inhouse_enterprise | enterprise | 999 | 999 | 1 |
The capabilities fall into tiers by edition: starter carries bench.connect and
automation.run; professional adds bench.live-view, test-cases.manage, reports.build and
artifacts.export; enterprise adds schedules.run, identity.sso and audit.log.
data/studio-license.json is created during the setup wizard and is the record of what the install
is entitled to run. Keep it with your backup, next to .db-config.json.
The control plane can withdraw a licence file that has already been issued, but withdrawal is not
instantaneous: a self-hosted deployment pulls the revocation list when it is online, and keeps
running when it cannot. The protection ceiling of an offline deployment is therefore the
expiresAt inside the file β an expired deployment must come online to renew, or take a new
licence file.
Registration licences are separate and narrower: each one is a single seat for one bench. See Agent registration and entitlements.
Database
The console supports three engines, chosen during the setup wizard: SQLite (better-sqlite3),
PostgreSQL (pg) and MySQL (mysql2). The wizard writes the choice to .db-config.json in the
console's working directory β {"dbType": "sqlite", "database": "velox", "initializedAt": "β¦"},
plus host, port, username and password for the server-based engines. With SQLite the
database is a file under DATA_DIR, default ./data/velox.db.
The engine is a storage choice only. On all three, the same console process serves the UI, the REST API and the realtime socket, and the same schema backs them.
Schema
The schema comes from three parallel DDL files β apps/console/lib/db/init.sqlite.sql,
init.postgresql.sql and init.mysql.sql β each defining 21 tables. They are applied once, by
the setup wizard's initialize step (POST /api/system/setup with {"step":"initialize"}).
SQLite executes the file as a whole; PostgreSQL and MySQL apply it statement by statement.
The 21 tables cover the platform end to end:
| Area | Tables |
|---|---|
| Identity and access | users, permissions, settings |
| Inventory | projects, products, environments, devices, vehicles, oems |
| Test domain | test_suites, test_cases, test_runs, executions, schedules, artifacts, reports |
| Agents | agents, agent_licenses, agent_commands, agent_keys, agent_sessions |
An upgraded console does not re-apply the schema. Keep a copy of the DDL you deployed and apply schema changes by hand inside the maintenance window.
Start order
The order matters: the console must be running before an agent can register.
- Start the console
pnpm install pnpm build pnpm --filter @velox/console startFor development,
pnpm --filter @velox/console devruns the same server with hot reload. The console listens on port 3002 by default and serves the UI, the REST API and the Socket.IO endpoint on that one port. - Complete the setup wizard
Open
http://<console-host>:3002. The wizard validates the licence, configures the database, applies the 21-table schema and creates the admin account. Until an admin exists the console keeps redirecting to the wizard. - Start the agents
On each bench:
pnpm install && pnpm --filter @velox/agent build && pnpm --filter @velox/agent start. The agent's own page opens on port 3005 and offers a registration form.For development,
pnpm --filter @velox/agent devruns the same page with hot reload.
Both start scripts run TypeScript through tsx, which ships as a development dependency. Install
the workspace with a plain pnpm install β a production-only install leaves the server without
the runner it starts with.
Keeping the processes running
The console is long-lived: it holds the Socket.IO connections and the database pool. The agent is long-lived on every bench. Run both under a supervisor so they come back after a crash or a reboot.
# /etc/systemd/system/velox-console.service
[Unit]
Description=FreeVelox
After=network.target
[Service]
Type=simple
User=velox
WorkingDirectory=/opt/velox/apps/console
Environment=NODE_ENV=production
Environment=PORT=3002
Environment=DATA_DIR=/var/lib/velox
Environment=VELOX_DATA_DIR=/var/lib/velox
ExecStart=/usr/bin/pnpm --filter @velox/console start
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.targetThe working directory is where .db-config.json, .setup-progress.json and .setup-complete are
found. DATA_DIR moves only the SQLite database file; those three stay in the working directory.
The licensing files live in the data directory (VELOX_DATA_DIR, ./data by default) and travel with
it.
The agent takes the same shape on the bench, with AGENT_HOST left at its default so the bench
page stays on the machine:
# /etc/systemd/system/velox-agent.service
[Unit]
Description=FreeVelox Agent
After=network.target
[Service]
Type=simple
User=velox
WorkingDirectory=/opt/velox/apps/agent
Environment=NODE_ENV=production
ExecStart=/usr/bin/pnpm --filter @velox/agent start
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.targetThe agent registers once, through its own page, and then reconnects on its own after a restart β
data/agent.json holds the credentials it needs.
systemctl enable --now velox-console
systemctl enable --now velox-agentThe console keeps three files in its working directory: .db-config.json (driver and connection
details), .setup-progress.json (setup progress, safe to delete once complete) and .setup-complete
(the marker that gates the wizard). The licensing files live in the data directory:
data/studio-license.json (the licence file itself), data/licence-state.json (the highest version
this machine has seen, the revocations and the quota cache) and data/deployment-id (this machine's
id).
Upgrading
git pull
pnpm install
pnpm buildStop the console process, take a backup (below), then start it again with
pnpm --filter @velox/console start. The wizard does not reappear: .setup-complete and
.db-config.json are still in place.
The socket envelope is {v, type, kind, id, timestamp, payload} and the protocol version is
negotiated during the handshake. Update the console and every agent in the same maintenance
window so that both ends speak the same version.
Backup and restore
What to back up, for a SQLite deployment (with the console stopped):
cp data/velox.db /backup/velox-$(date +%F).db
cp .db-config.json .setup-complete /backup/
cp data/studio-license.json data/licence-state.json data/deployment-id /backup/For PostgreSQL and MySQL, use the engine's own dump tooling (pg_dump, mysqldump) and back up
.db-config.json alongside it. The database is the source of truth; the JSON files only tell the
console how to reach it and what it is entitled to run.
Restore in this order: stop the console; put the database back; put .db-config.json back in the
console's working directory β without it the console presents the setup wizard again and starts with
an empty view of the world; then start the console and confirm the agent list is populated.
The agent's own state lives on the bench in data/agent.json, in plain text. It is not part of the
console's backup set β but the console's agents table holds the same api_key and agent_secret
values, so a database backup carries the same secret material.
Related pages
- Network requirements β who dials whom, and which ports.
- Agent registration and entitlements β issuing licences.
- Device topology and physical connection β wiring the benches.
- Configuration β every environment variable and file.
- Setup wizard β the first-run flow.