Nebula Commander device client (ncclient): enroll with a one-time code, then run as a daemon to pull config and certs and optionally orchestrate Nebula.
Project description
ncclient – Nebula Commander device client
License: GNU GPLv3 or later. See LICENSE in this directory.
A small client that works like Defined.net’s dnclient and dnclientd: enroll once with a code from Nebula Commander, then run as a daemon to pull config and certificates and optionally orchestrate the Nebula process (start/restart it when config changes).
Install
From PyPI (recommended):
pip install nebula-commander
This installs the ncclient command. Requires Python 3.10+.
From source (e.g. repo clone):
pip install -r client/requirements.txt
# then run as: python -m client --server URL enroll --code XXX
Or install the package in development mode from the client/ directory: pip install -e . to get the ncclient command.
Enroll (one-time)
- In Nebula Commander, open Nodes, find your node, and click Enroll.
- Copy the enrollment code and run on the device:
ncclient enroll --server https://YOUR_NEBULA_COMMANDER_URL --code XXXXXXXX
This saves a device token to ~/.config/nebula-commander/token (or /etc/nebula-commander/token when run as root).
Run (daemon)
Poll for config and certs every 60 seconds, write them to /etc/nebula (or another directory), and run Nebula (from your PATH) when config changes:
ncclient run --server https://YOUR_NEBULA_COMMANDER_URL
ncclient assumes nebula is on your PATH and will start/restart it by default. Options:
--output-dir DIR– where to writeconfig.yaml,ca.crt,host.crt(default:/etc/nebulaon Linux/macOS,~/.nebulaon Windows)--interval N– poll interval in seconds (default: 60)--token-file PATH– path to device token file--nebula PATH– path to thenebulabinary only if it’s not in PATH (e.g.--nebula /opt/homebrew/bin/nebula). Omit this whennebulais already on your PATH.--restart-service NAME– instead of running nebula directly, restart this systemd service after config updates (e.g.nebula). Use only one of--nebulaor--restart-service.
Example – nebula in a non-standard location:
ncclient run --server https://nc.example.com --nebula /usr/local/bin/nebula
Example – use systemd to run Nebula; ncclient only restarts the service:
ncclient run --server https://nc.example.com --restart-service nebula
When the certificate was created via the server (Create certificate in the Nebula Commander UI), the bundle includes host.key and no manual copy is needed. For certificates created via Sign (betterkeys, client-generated key), the server does not have the key; place your own host.key in the same directory as the generated certs.
Linux: Creating the Nebula TUN device requires root. Run ncclient as root so the Nebula process can create the interface, e.g. sudo ncclient run --server https://... (or use --output-dir ~/.nebula and run as root so nebula reads from a dir that has host.key).
Troubleshooting
-
No network device (tun) created / can’t ping Nebula IP
On Linux, Nebula needs root to create the TUN interface. Runsudo ncclient run --server ....
If the certificate was created via the server (Create certificate in the UI), the bundle includeshost.keyand no manual copy is needed. If it was created via Sign (betterkeys), put yourhost.keyin the output dir (e.g./etc/nebula). Nebula will exit or fail withouthost.key.
Nebula’s errors are printed to the same terminal; look for messages like “failed to get tun device” (permission) or “no such file” (missing host.key). -
Nebula starts then exits
Check the Nebula error lines ncclient prints. Common causes: missinghost.key(for Sign flow; Create flow includes it in the bundle), wrong config path, or (Linux) need to run as root.
Running as a service
Run ncclient run under systemd (or your init system) so config and certs stay up to date. ncclient runs nebula from your PATH by default; use --restart-service if you prefer to have systemd run Nebula and ncclient only restart the service.
macOS
ncclient works on macOS (Intel and Apple Silicon). Use Python 3.10+ and install with pip install nebula-commander.
- Token is stored at
~/.config/nebula-commander/token(or/etc/nebula-commander/tokenwhen run as root). - Default output dir is
/etc/nebula(same as Linux). If you run as a normal user, use--output-dir ~/.nebulaso you don’t need sudo to write config/certs. - Nebula: ncclient runs
nebulafrom your PATH by default. Afterbrew install nebula, you usually don’t need--nebula. Use--nebula /opt/homebrew/bin/nebula(Apple Silicon) or--nebula /usr/local/bin/nebula(Intel) only if it’s not on PATH. Do not use--restart-service; macOS uses launchd, not systemd. - To run ncclient in the background, use launchd (e.g. a LaunchAgent in
~/Library/LaunchAgentsor a LaunchDaemon in/Library/LaunchDaemons).
Windows 11
ncclient works on Windows 11. Use Python 3.10+ and install with pip install nebula-commander.
- Token is stored under
%USERPROFILE%\.config\nebula-commander\token. - Default output dir for config and certs is
%USERPROFILE%\.nebula. Override with--output-dir(e.g.C:\ProgramData\Nebulaif you run as Administrator). - Nebula: ncclient runs
nebulafrom your PATH by default. Ifnebula.exeis not on PATH, use--nebula "C:\Path\To\nebula.exe". Do not use--restart-service; there is no systemd on Windows. - Run ncclient in a terminal or install it as a Windows service (e.g. with NSSM or Task Scheduler) so it keeps running.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nebula_commander-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nebula_commander-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
552cdbc600d4a5e6847ee03ab8c3fda7f1e36a30396ce093372b90de695c4e4a
|
|
| MD5 |
f1171be9903042c4d2fe71fa79218601
|
|
| BLAKE2b-256 |
ef802132d6c7f1d980f521af2a0fed3d05fe1cf0dcd053aad52be59c0c3e49a3
|