Skip to content

nhub commands ​

nhub is the hub's command line, installed with the hub package on the machine that runs the hub. The table lists its subcommands in the order nhub --help prints them.

Subcommands ​

Root marks a subcommand that needs root on Linux and macOS, or an administrator terminal on Windows. Without it, the subcommand prints the line to run and exits with status 2. Asks marks a subcommand that asks one [y/N] question first. --yes answers it; without a terminal and without --yes, the subcommand prints a line naming --yes and exits with status 1.

CommandArguments and flagsRootAsksWhat it does
nhub setup--stdin reads the answers as JSON; --json <path> reads them from a fileyesnoSets this machine up one time, in the browser wizard or the terminal. Rejected once a panel password is set.
nhub run--host, --port, --reload, --interface; one --only- flag naming a unitnonoRuns one hub process in the foreground, as every neutrino_hub_* unit does.
nhub open--print prints the address; --start-service, --output <path> are internalnonoOpens the panel, or the wizard before setup, in the browser, starting a stopped service after an administrator prompt.
nhub start--interface; --yes; one --only- flag naming a unityesyesStarts every enabled unit, routing state first and panel last, or the one unit named. On macOS and Windows it starts the hub's one service.
nhub stop--interface; --yes; one --only- flag naming a unityesyesStops every unit, panel first, or the one named; modules and virtual networks keep running. On macOS and Windows it stops the one service.
nhub statusnonoPrints each hub unit's state on Linux, or the one service's on macOS and Windows. Exits with status 0 while the panel runs.
nhub service runrun is the only actionyesnoRuns the hub as the Windows service. From a terminal it exits with status 1, and on another system with 2.
nhub apply--only <component>; --dry-run prints the files; --skip-apply only writesyesnoRenders every generated configuration from config/, validates it and applies it, in the panel's order.
nhub unlockyesnoClears the panel's login lockout and every fail2ban SSH ban.
nhub resetall, network or password; --stdin reads the new password; --yesyesyespassword sets a new panel password. network hands the network back. all also resets config/, deletes the keys and stops the hub.
nhub update--yes; --package <file> installs that file instead of the newest releaseyesyesInstalls the newest release, checks the hub's health for three minutes, and puts the previous version back when the check fails.
nhub vault rekey--stdin reads the new passphraseyesnoWraps the vault's data key under a new passphrase; nothing sealed is encrypted again.
nhub scan-secrets--staged, --history, --no-entropy, --no-vendor, --quietnonoChecks the working tree, the staged files or every commit for credentials. A development command.

The --only- flags exist on Linux alone, one per systemd unit: web, xray, cliproxyapi, dnsmasq, relay for the SSH Relay, router, supplicant and dhcpcd; --only-supplicant and --only-dhcpcd need --interface. --only <component> of nhub apply takes router, xray, dnsmasq, cliproxyapi or overlay. xray exists in the full edition only. Uninstall uses nhub reset network and nhub reset all.

Global flags ​

FlagWhereWhat it does
--versionnhubPrints the package version and exits.
--devnhub, before the subcommandRuns against hub_dev_root/ in a working copy and lifts the root check; a packaged hub exits.
-hevery levelPrints that level's help and exits.

Exit statuses ​

StatusWhen
0The subcommand finished, or found nothing to do.
1The answer to [y/N] was no, a step failed, or nhub status found the panel stopped.
2Root was missing; nhub or nhub reset named nothing; an --only- flag ran off Linux; nhub update ran from a working copy.
130Ctrl-C stopped the subcommand.

Neutrino · personal developer infrastructure