Installation
Thenetbird CLI is automatically installed with the NetBird client. See the installation guide for platform-specific instructions.
Basic Usage
Available Commands
netbird up- Connect to the NetBird networknetbird down- Disconnect from the NetBird networknetbird status- Display connection status and peer informationnetbird login- Authenticate with the management servernetbird logout- Log out from the NetBird networknetbird service- Manage the NetBird daemon servicenetbird networks(alias:routes) - Manage network routes and resourcesnetbird ssh- Connect to NetBird peers via SSHnetbird version- Display version information
Global Flags
These flags can be used with any command:Daemon service address for CLI requests. Format:
[unix|tcp]://[path|host:port]Management Service URL. Format:
[http|https]://[host]:[port]Short form: -mAdmin Panel URL. Format:
[http|https]://[host]:[port]Sets NetBird log level. Options:
trace, debug, info, warn, errorShort form: -lSets NetBird log file paths. Can be specified multiple times or as comma-separated list.Special values:
console- Output to stdoutsyslog- Send to syslog daemon
Setup key obtained from the Management Service Dashboard (used to register peer)Short form:
-kPath to a file containing the setup key. Ignored if
--setup-key is provided.Sets a custom hostname for the deviceShort form:
-nSets WireGuard PreSharedKey property. If set, only peers with the same key can communicate.
Anonymize IP addresses and non-netbird.io domains in logs and status outputShort form:
-AOverrides the default profile file locationShort form:
-cDefault paths:- Linux/FreeBSD:
/etc/netbird/config.json - macOS:
/etc/netbird/config.json - Windows:
%PROGRAMDATA%\Netbird\config.json
NetBird system service nameShort form:
-sEnvironment Variables
All flags can be set via environment variables using theNB_ or WT_ prefix (for backwards compatibility):
- Flag names are converted to uppercase
- Dashes are replaced with underscores
- Prefixed with
NB_orWT_
Configuration File
The NetBird configuration file is stored at:- Linux/FreeBSD:
/etc/netbird/config.json - macOS:
/etc/netbird/config.json - Windows:
%PROGRAMDATA%\Netbird\config.json
- Management server URL
- Private key
- WireGuard interface configuration
- Network settings
- SSH settings
Daemon Socket
The NetBird CLI communicates with the NetBird daemon service via:- Linux/macOS: Unix socket at
/var/run/netbird.sock - Windows: TCP socket at
127.0.0.1:41731
Exit Codes
0- Success1- General error- Non-zero - Command-specific error