Marcio Cunha

Secure corporate network? How to set up NetBird from scratch

Learn how to deploy a secure overlay network with NetBird from scratch, connecting servers and workstations directly and with full encryption.

Marcio Cunha•5 min
Also available in:PortuguêsEspañol
Summary
  • Overlay networks create a private logical layer over the public internet using end-to-end encryption.
  • NetBird simplifies WireGuard VPN deployments without the complexity of managing manual cryptographic keys.
  • Automatic node discovery allows direct peer-to-peer connections even behind routers running NAT.
  • Granular policy-based access controls replace traditional static and complex firewall rules.
  • Integration with identity providers ensures centralized and secure authentication for the entire team.

The challenge of connecting teams and servers securely

Working with distributed servers and remote teams requires a network infrastructure that is both flexible and impenetrable. In the past, we relied on traditional virtual private networks built around central concentrators, where all company traffic had to flow through a single bottleneck. In practice, this meant that if the central server went down or suffered from high latency, the entire operation ground to a halt. Furthermore, managing manual certificates and encryption keys for every new team member was an exhausting task prone to human error.

To solve this bottleneck and complexity, modern engineering has adopted overlay networks, which are virtual networks built on top of the public internet. Imagine creating an invisible, encrypted tunnel directly between your laptop and the cloud server, without depending on intermediate routers. This decentralized approach eliminates single points of failure and ensures high performance. If you ever needed to inspect traffic to understand bottlenecks, you know the value of clean utilities, such as when we use tcpdump to capture packets and diagnose transport layer latencies.

What is NetBird and why it uses WireGuard

NetBird emerges as a modern open-source solution built on top of the WireGuard protocol, known for its extreme speed and minimal battery and CPU consumption. Unlike heavy legacy protocols, WireGuard features very few lines of code, making security audits much simpler. In practice, NetBird acts as a centralized control panel that automates key distribution and the establishment of these secure connections, eliminating the headache of configuring static config files across dozens of machines.

Another major differentiator is the ability to perform direct peer-to-peer connections between network nodes, a concept known in engineering as NAT traversal. This means that even if two computers are hidden behind home or corporate routers with strict firewalls, the system negotiates a direct path between them. If direct connection is blocked by extreme network restrictions, traffic automatically falls back through encrypted relay servers, ensuring communication never becomes entirely unavailable.

Preparing the environment and installing the control panel

To begin our zero-deployment journey, the first step involves hosting the NetBird control panel or using the managed cloud version for quick tests. The panel manages users, connected machines, and access policies. On the server chosen to run the application, we typically use Docker Compose to keep everything isolated and easy to update. Before pushing your infrastructure to production, it is wise to ensure external traffic is well-filtered, applying concepts similar to those we use when we block malicious network packets with iptables to shield sensitive ports against unwanted access.

Installing the client on end devices is quite straightforward and can be automated via provisioning scripts or package managers. The agent runs in the background consuming minimal operating system resources. Below is the basic command to install the client on Linux-based systems:

curl -sSL https://pkgs.netbird.io/install.sh | sh

After successful agent installation, the next step requires you to authenticate the device into your centralized control panel. This process usually uses a web browser to validate your corporate identity through providers like Google, GitHub, or Keycloak.

Centralized authentication and registering the first nodes

The security of a corporate network begins at the front door, meaning how new users and devices prove who they are. NetBird integrates natively with modern identity providers using the OpenID Connect standard. In practice, this means the same username and password a collaborator uses to access corporate email will be required to release their access to the overlay network. Additionally, you can enable two-factor authentication to elevate protection levels.

When the user runs the login command in the terminal, the agent opens a browser window or provides a confirmation link. Upon successful validation, the panel issues a short-lived certificate and adds the device to the active nodes list. From that exact moment, the virtual IP is automatically assigned to the NetBird network interface, allowing the machine to see other authorized resources without exposing any unnecessary ports to the public internet.

To check if connectivity is working smoothly between newly registered nodes, we can run basic communication tests on the command line. Here is an example command to check the current service status and connected peers:

netbird status

With the command above, the operator can view the assigned IP address on the private network, the connection status with the central manager, and the list of neighboring peers reachable at that exact moment.

Configuring access policies and network segmentation

One of the biggest mistakes in information security is granting full network access to any authenticated device. NetBird solves this vulnerability by offering a robust policy-based access control engine, known in technical literature as ACLs. In practice, you can create logical machine groups — such as the developer group, database server group, and mobile device group — and define strict rules about who can talk to whom.

For instance, you can configure a rule where only the software engineering group can establish tunnels with the staging environment, while the finance department has access restricted exclusively to reporting servers. This segmentation prevents a single compromised laptop from spreading an infection laterally to the rest of the corporate infrastructure. This least-privilege architecture is the gold standard for maintaining resilient environments. To explore these architectural concepts further in production, see our related technical analysis on Remote access without traditional VPN? How to use NetBird.

Conclusion and Next Steps

Deploying an overlay network based on NetBird radically transforms a company's security posture and operational agility. By eliminating the need for traditional, complex VPN concentrators, the organization gains a flexible infrastructure that connects teams and servers directly, with encryption and full transparency. Teams stop wasting time dealing with manual configuration files and start focusing on what truly matters to the business.

Implementing granular access policies and centralized authentication ensures company growth happens without opening security loopholes. As your infrastructure evolves, it is worth exploring advanced features like creating exit nodes to route external traffic securely or integrating with physical gateways to connect entire local networks to the NetBird ecosystem.