
NetBird is an open-source peer-to-peer VPN platform that creates secure, private networks across distributed infrastructure. It builds encrypted mesh networks on top of WireGuard, allowing nodes in different regions or providers to communicate over low-latency private tunnels without manual firewall or port forwarding.
This guide explains how to self-host the NetBird control plane on a Vultr instance and extend the mesh to include an Amazon EC2 server. You provision Vultr and AWS resources, adjust AWS Security Group rules, add peers with setup keys, and verify connectivity. You also configure a Vultr peer as an exit node, routing AWS traffic through Vultr for centralized control and monitoring.
Before setting up your Vultr–AWS mesh network, make sure you have:
netbird.example.com.us-east-1), with an Elastic IP (EIP) address attached to it.The control plane is the central service that coordinates peer connections in your NetBird network. In this setup, you host it on a Vultr instance and install the required components with Docker. The deployment brings up the management interface, signaling service, TURN/STUN, and a bundled identity provider (Zitadel).
Open the necessary ports on your Vultr control plane to handle HTTPS, signaling, management, and TURN/STUN traffic.
Add Docker’s official repository and install Docker Engine, the Compose plugin, and required utilities.
Enable and start the Docker service.
Add your user to the Docker group so you can run containers without sudo.
Verify that the Docker Compose plugin is available.
Run the NetBird installer with your domain set in the NETBIRD_DOMAIN environment variable.
Replace netbird.example.com with the domain pointing to your Vultr control plane instance.
When the installation finishes, the NetBird dashboard is available at:
Copy the credentials and setup key shown in your terminal before closing it.
Do not close your terminal before copying the setup key and credentials. These values are only shown once during installation.
Amazon EC2 instances use Security Groups to control inbound and outbound traffic. Before you attach an EC2 peer to your NetBird network, update its Security Group so the instance can reach the Vultr control plane and exchange encrypted traffic.
Log in to the AWS Management Console.
Navigate to EC2.
In the left sidebar, click Instances.
Select the EC2 instance you want to configure.
Click the Security tab in the instance details pane.
Under Security Groups (SG), click the linked Security Group name to view or edit it.
Add rules that allow outbound access to the following ports:
Verify connectivity from the EC2 instance to your Vultr control plane domain.
A response such as 200 OK confirms the peer can reach the control plane.
To connect Vultr and AWS servers to your NetBird mesh, use setup keys. Setup keys are pre-authorized tokens that let peers join automatically without requiring an interactive login. See the NetBird Setup Keys documentation for more details.
In the NetBird Admin Panel, go to Setup Keys and click Create Setup Key.
multi-cloud-peers).Install the NetBird client on each peer.
Register the peer with your self-hosted control plane.
Replace <SETUP_KEY> with the copied key.
In the Admin Panel, verify that the peer appears online. Rename it to something descriptive, such as vultr-ams or aws-ec2, and add it to the appropriate group if you plan to configure an exit node later.
After registering both Vultr and AWS peers, confirm that they can communicate securely over the NetBird mesh.
In the Admin Panel, open the Peers tab.
100.x.x.x NetBird-assigned mesh IP address.From one peer (for example, your Vultr AMS VM), test connectivity to the AWS EC2 peer using its NetBird mesh IP.
If the ping succeeds, the private overlay network is working correctly.
Your output should be similar to the one below:
Repeat the test in the opposite direction (from AWS EC2 > Vultr peer) to confirm two-way connectivity.
You can configure one peer as an exit node so other peers route their internet traffic through it. In this example, the Vultr AMS instance acts as the exit node, and the AWS EC2 peer forwards its traffic through it.
In the Peers tab of the NetBird Admin Panel, select the peer named vultr-ams.
Scroll down and click Set Up Exit Node.
Enter an identifier such as ams-exit.
In the Distribution Groups dropdown, select or create a group that will include the AWS peer (for example, aws-nodes).
Click Continue and then Save Changes.
The vultr-ams instance is now configured as an exit node.
aws-ec2).aws-nodes group.vultr-ams as an exit node.To confirm that AWS traffic flows through the Vultr exit node, run the following commands on the AMS-region Vultr peer.
Enable IP forwarding.
Add a MASQUERADE rule to NAT outbound traffic via the correct network interface.
Check that forwarding is enabled.
Monitor the NAT rule counters.
The output shows a live counter of packets hitting the MASQUERADE rule. The values increase as traffic from the AWS peer passes through the Vultr exit node.
If packet counts do not increase, verify that the AWS peer is assigned to the aws-nodes group and ensure its Security Group allows outbound connections.
In this guide, you deployed a NetBird control plane on Vultr and extended the mesh network to an AWS EC2 instance. You added peers using setup keys, confirmed private connectivity, and configured a Vultr exit node to handle AWS traffic. This configuration enables you to build secure, low-latency multi-cloud networks that connect Vultr and AWS workloads while giving you control over routing, monitoring, and egress.
0 Comments
Be the first to comment and share your perspective with the community.