Infrastructure Requirements
Hardware Requirements
For a production deployment, you’ll need:- Linux VM with at least 1 CPU and 2GB RAM
- More resources may be needed for larger deployments (100+ peers)
- Additional storage for logs and database (5GB+ recommended)
Network Requirements
The server must be publicly accessible on the following ports:These ports must be open in your firewall and properly forwarded if behind NAT.
| Port | Protocol | Service | Required |
|---|---|---|---|
| 80 | TCP | HTTP (redirect to HTTPS) | Yes |
| 443 | TCP | HTTPS (Dashboard, Management API, Signal, Relay) | Yes |
| 3478 | UDP | STUN/TURN (NAT traversal) | Yes |
| 51820 | UDP | WireGuard (for Proxy service) | Optional |
Domain Requirements
You need a public domain name pointing to your server’s IP address. The getting-started script uses this domain to:- Generate TLS certificates via Let’s Encrypt
- Configure OAuth2 endpoints for the embedded identity provider
- Enable secure client connections
Software Requirements
Docker
NetBird requires Docker with the docker-compose plugin (or docker-compose v2+):Required Utilities
The setup script requires these utilities:- jq - JSON processor for configuration parsing
- curl - For downloading configuration and testing endpoints
Architecture Overview
A self-hosted NetBird deployment consists of:NetBird Server (Combined)
Starting with recent versions, NetBird uses a combined server container that includes:- Management Service - Handles peer registration, network state, and access policies
- Signal Service - WebRTC signaling for peer-to-peer connection establishment
- Relay Service - WebSocket relay for peers that cannot connect directly
- STUN Service - NAT discovery and traversal
- Embedded Identity Provider - OAuth2/OIDC provider (using Dex)
- Port 80 (HTTP) internally
- Exposed via reverse proxy on port 443 (HTTPS)
Dashboard
The web-based admin interface for:- Managing peers and access policies
- Viewing network activity
- Configuring routes and DNS
- User management
Reverse Proxy (Optional)
The getting-started script can configure:- Built-in Traefik (recommended) - Automatic TLS via Let’s Encrypt
- External Traefik - Integration with existing Traefik instance
- Nginx - Manual TLS certificate configuration
- Nginx Proxy Manager - GUI-based configuration
- Caddy - Automatic TLS with simple configuration
- Other/Manual - Custom reverse proxy setup
Storage
NetBird uses SQLite by default for storing:- Peer information and metadata
- Access policies and network configuration
- User accounts and activity logs
netbird_data- Management database and statenetbird_traefik_letsencrypt- TLS certificates (if using built-in Traefik)
For production deployments with many peers, you can configure PostgreSQL or MySQL as the database backend by setting environment variables in the configuration.
Identity Provider Options
Embedded Identity Provider (Default)
The getting-started.sh script configures an embedded identity provider using Dex:- No external IdP required
- OAuth2/OIDC compliant
- Built into the management server
- Endpoints automatically configured at
/oauth2
External Identity Providers
For advanced setups, NetBird supports integration with:- Zitadel - Use
getting-started-with-zitadel.sh - Auth0 - Commercial identity platform
- Keycloak - Open-source identity management
- Azure AD - Microsoft identity platform
- Google Workspace - Google OAuth
- Okta - Enterprise identity provider
- OAuth2 client registration in your IdP
- Configuring OIDC endpoints in
setup.env - Running
configure.shto generate configuration files
Configuration Files
Self-hosted deployments use these configuration files:config.yaml (Combined Server)
Generated by getting-started.sh with settings for:dashboard.env
Environment variables for the dashboard:docker-compose.yml
Orchestrates all services with proper networking and volume mounts.Data Encryption
NetBird encrypts sensitive data at multiple levels:- Datastore Encryption Key - Encrypts sensitive data in the database (auto-generated)
- Relay Auth Secret - Authenticates peers to the relay service (auto-generated)
- WireGuard Keys - End-to-end peer-to-peer encryption
Quick Start Command
The fastest way to get started with self-hosting:- Prompt for your domain name
- Choose reverse proxy configuration (Traefik recommended)
- Generate all configuration files
- Start NetBird services
- Configure automatic TLS certificates
Next Steps
Docker Compose
Deploy with Docker Compose using the getting-started script
Kubernetes
Deploy NetBird on Kubernetes clusters
Identity Providers
Configure external identity providers
Cloud vs Self-Hosted
Compare NetBird Cloud with self-hosted options