Groups
Groups are the fundamental building blocks of NetBird’s access control system. They allow you to organize peers (network devices) and users into logical collections that can be referenced in policies, routes, and DNS configurations.Group Types
NetBird supports different types of groups based on how they’re created:API Groups
Created manually through the NetBird dashboard or API. These are the most common type of group.JWT Groups
Automatically synchronized from your identity provider (IdP) based on JWT token claims. These groups reflect your organization’s existing user directory.JWT groups are synchronized when users authenticate. Group membership is automatically updated based on the user’s claims in the JWT token.
Integration Groups
Created by third-party integrations and automation tools.Creating Groups
Groups can be created through the NetBird dashboard, API, or CLI.production-servers, dev-team)Group Membership
Manual Membership
For API groups, you explicitly add and remove peers:Auto-Grouping with Setup Keys
When creating setup keys, you can specify auto-groups. Peers registered with that setup key are automatically added to the specified groups.Auto-Grouping with User Assignment
Users can have auto-groups assigned. When a user’s device joins the network, it’s automatically added to the user’s groups.The “All” Group
Every NetBird account has a special built-in group called “All”:- Contains all peers in the account
- Automatically includes new peers
- Cannot be deleted
- Useful for account-wide policies
Group Resources
Groups can contain not only peers but also network resources:- Subnets accessible via routing peers
- Network services
- Cloud resources
Group Validation
When creating or updating groups, NetBird validates:- Unique names: For API groups, names must be unique within the account
- Valid peer IDs: Referenced peers must exist in the account
- ID assignment: Integration/JWT groups require pre-assigned IDs; API groups get auto-generated IDs
Group Dependencies
Before deleting a group, NetBird checks if it’s referenced by:- Policies: Source or destination groups in access rules
- Routes: Peer groups, distribution groups, or access control groups
- DNS: Nameserver distribution groups
- Setup Keys: Auto-group assignments
- Users: Auto-group assignments
- Settings: DNS disabled management groups, integrated validators
Why can't I delete this group?
Why can't I delete this group?
Groups cannot be deleted if they’re referenced by other resources. You’ll receive an error message indicating what resource is using the group. Remove the group from those resources first, then try deleting again.Example error:To resolve: Edit the “Production Access” policy to remove this group from its source or destination groups.
Group Operations and Performance
Group changes are optimized to minimize network updates:- Is the group used in any active policies?
- Is the group used in any enabled routes?
- Is the group referenced in DNS nameserver configurations?
- Does the group contain any peers or resources?
Group Best Practices
Use Descriptive, Hierarchical Names
Use Descriptive, Hierarchical Names
Organize groups with a consistent naming scheme:
Minimize Group Overlap
Minimize Group Overlap
Avoid creating too many overlapping groups with the same peers. This makes policies harder to understand and maintain. Instead, use fewer, well-defined groups.❌ Bad:✅ Good:
Leverage Auto-Grouping
Leverage Auto-Grouping
Use setup keys and user auto-groups to automatically organize peers as they join:
Document Group Purpose
Document Group Purpose
Use clear descriptions to explain what each group represents and who should be added to it. This helps team members understand the access control structure.
Group Event Logging
All group operations are logged as activity events:GroupCreated: New group createdGroupUpdated: Group name or properties changedGroupDeleted: Group removedGroupAddedToPeer: Peer added to groupGroupRemovedFromPeer: Peer removed from groupGroupAddedToDisabledManagementGroups: Group added to DNS disabled management
API Reference
Key group management functions from the source code:Related Resources
- Access Control - Overview of NetBird’s security model
- Policies - Create access rules using groups
- Routes - Route traffic to group members
- DNS - Distribute DNS to groups