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:string
Daemon service address for CLI requests. Format:
[unix|tcp]://[path|host:port]string
default:"https://api.netbird.io"
Management Service URL. Format:
[http|https]://[host]:[port]Short form: -mstring
default:"https://app.netbird.io"
Admin Panel URL. Format:
[http|https]://[host]:[port]string
default:"info"
Sets NetBird log level. Options:
trace, debug, info, warn, errorShort form: -lstring
default:"/var/log/netbird/client.log"
Sets NetBird log file paths. Can be specified multiple times or as comma-separated list.Special values:
console- Output to stdoutsyslog- Send to syslog daemon
string
Setup key obtained from the Management Service Dashboard (used to register peer)Short form:
-kstring
Path to a file containing the setup key. Ignored if
--setup-key is provided.string
Sets a custom hostname for the deviceShort form:
-nSets WireGuard PreSharedKey property. If set, only peers with the same key can communicate.
boolean
default:"false"
Anonymize IP addresses and non-netbird.io domains in logs and status outputShort form:
-Astring
default:"/etc/netbird/config.json"
Overrides the default profile file locationShort form:
-cDefault paths:- Linux/FreeBSD:
/etc/netbird/config.json - macOS:
/etc/netbird/config.json - Windows:
%PROGRAMDATA%\Netbird\config.json
string
default:"netbird (Windows: Netbird)"
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