Getting Started
Core concepts — the policy chain, sync, VPN, and more.
Welcome to NetDefense — a CLI-first management platform for teams running fleets of decentralized OPNsense firewalls. This page is the complete path from “no account” to “device authorized and managed.” It takes about 15 minutes and you shouldn’t need to leave this page.
You’ll need one thing you don’t already have from NetDefense: an OPNsense 25.7 firewall you can reach via a physical keyboard/monitor, a VM console, or SSH. Everything else — your account, your organization, the agent — gets created along the way.
Both routes below end up in the same place: an account with credentials set, mandatory multi-factor authentication (MFA) enrolled, and NDWeb showing an empty environment with no organizations yet.
You land on an empty dashboard — no organizations yet.
Install NDCLI first if you haven’t (platform-specific instructions), then run the guided setup wizard:
ndcli setupAn organization is NetDefense’s top-level container — every device, policy, and account lives inside one. You need one before you can deploy NDAgent in Step 3. Creating one only takes a name.
That’s it. The organization’s registration token is embedded automatically when you deploy a device in Step 3 — you won’t need to copy or track it by hand.
Continuing the ndcli setup session from Step 1: when it asks, answer yes to Create your first organization? and give it a name — that’s the only required field.
The wizard prints your registration token directly in its closing summary. Copy it now; you’ll need it in Step 4.
Prefer to skip the wizard? Create the organization directly and the token prints immediately:
ndcli org create acme-lab✓ Organization created and set as default: acme-lab Token: 9fc86b59-a821-465a-bb29-6ffd7f3a9165
Use this token to register devices with the NetDefense agent.To retrieve the token later: ndcli org describe acme-labMisplaced it later? ndcli org describe <org-name> prints it again under Registration Token.
From here the two routes converge on where you install — NDAgent goes on the OPNsense box itself, not on your workstation — though the exact command you’ll run still depends on which route you took.
https://<lan-ip>) and go to System → Settings → Administration. Check Secure Shell Server and Save.ssh root@<lan-ip>. All three land on the same OPNsense console menu.Go to Devices and select Deploy Device (the same button appears in the empty state, since this is your first device). In the dialog’s Unattended tab, copy the install command — your registration token is already embedded — and paste it at the root prompt:
curl -sSL https://repo.netdefense.io/install.sh | sh -s -- --auto-setup=<token>This installs the plugin, provisions its OPNsense API credentials, and registers the device — all in one step. Skip ahead to Step 5 to approve it.
Would rather not put a live credential into this shell’s history? Switch to the dialog’s Manual tab for a plain install command plus the token shown separately, then continue to Step 4 to finish configuring the plugin by hand.
curl -sSL https://repo.netdefense.io/install.sh | shThis is the exact command ndcli setup printed for you at the end of Step 1/2. It sets up the NetDefense package repository and installs the plugin; continue to Step 4 to finish configuring it from the web UI with the token you copied in Step 2.
exit) to return to the console menu, then log out (0) Logout) or disconnect.Installing the package doesn’t connect anything yet. The plugin needs its own OPNsense API credentials and your organization’s registration token before it will register with NetDefense.
netdefense-agent OPNsense user with the minimum privileges the agent needs — you don’t fill in anything yourself.The agent starts and registers with NetDefense. Watch it happen under Services → NetDefense → Log File, or see the full field-by-field breakdown in Configuration.
The agent is now talking to NetDefense, but it sits in PENDING until someone approves it — a deliberate checkpoint so a leaked registration token can’t silently add a rogue device to your fleet.
Go to Devices. Your firewall appears with status PENDING. Open its row’s … menu and select Approve.
ndcli device list --status PENDING
ndcli device approve <device-name>Approving a whole batch of freshly-installed devices at once? ndcli device approve-all approves everything currently PENDING.
Once approved, the device is ENABLED and ready to receive policy.
From here, everything else in NetDefense builds on what you just set up — assign the device to an organizational unit, attach a template, and sync it.
Getting Started
Core concepts — the policy chain, sync, VPN, and more.
NDCLI
The full command-line reference.
NDAgent
Advanced install methods, updates, and troubleshooting.
MCP Server
Drive NetDefense from Claude Code, Claude Desktop, or any MCP-compatible client.
Have questions about NetDefense? Contact us or visit app.netdefense.io to get started.