Documentation
First `vectron.toml`
Understand the smallest useful Vectron configuration and how paths, ports, and environment variables behave.
Minimal example
[[process]]
name = "web"
command = "npm run dev"What this does
[[process]]declares one supervised processnamedefines the stable identifier used in status, logs, restart targets, and file namescommanddefines the child process to launch
Defaults involved here
global: optional tablelog_dir: default.vectron/logsport_start: default5000port_step: default100shutdown_timeout_secs: default90instances: default1log_mode: effective defaultconsolelog_format: effective defaulttextshow_timestamps: effective defaulttrueport_env: field default none; effective port variablePORTunless overridden
Path resolution
Paths such as log_dir, working_dir, and env_file are resolved relative to the directory that contains vectron.toml.
This means that moving the config file changes the meaning of those relative paths.
When you need a port
Vectron allocates a port for each process instance. When a process has an allocated port, Vectron exports it as PORT by default.
If your app reads PORT from its environment, the minimal config can stay unchanged:
[[process]]
name = "web"
command = "npm run dev"Use port_env only when the child process expects another variable name:
[[process]]
name = "web"
command = "npm run dev"
port_env = "APP_PORT"port_env changes the environment variable name. It does not interpolate values inside command. If a command must expand $PORT directly in its arguments, run it through a shell explicitly.
Process naming
Choose stable names. They appear in:
vectron statusvectron restart <target>vectron logs --target <target>- log file names under
.vectron/logs
Next useful additions
After the minimal config, the most common next steps are:
- add
instances = N - set
group = "name"and optionallabels = [...] - add
[process.env] - define readiness with
[process.readiness] - define
log_format = "json"orlog_format = "logfmt"
Use the full reference for vectron.toml for exact field behavior and defaults. Use Examples when you want complete patterns that are still short enough to adapt.