RamNode logo
VPN Setup Guide

Netbird VPN Setup

Set up a modern, open-source VPN solution using Netbird on your RamNode VPS. Create peer-to-peer connections with WireGuard technology and simplified management.

Ubuntu 24.04+
Netbird VPN
⏱️ 20-30 minutes
1

Why Choose Netbird?

Netbird is a modern, open-source VPN solution that simplifies secure networking between devices. Unlike traditional VPN setups, Netbird creates peer-to-peer connections using WireGuard under the hood, making it faster and more efficient.

Key Benefits

  • Modern WireGuard technology
  • Peer-to-peer mesh networking
  • Web-based management interface
  • Cross-platform client support

Why RamNode?

  • Reliable, affordable VPS hosting
  • Modern kernel support
  • Excellent performance characteristics
  • Ubuntu 24+ images available
2

Prerequisites

Before beginning the Netbird installation, ensure you have the following:

3

Initial VPS Setup

First, connect to your RamNode VPS via SSH and update the system:

Connect to your VPS
ssh root@your-vps-ip
Update system packages
apt update && apt upgrade -y
Install essential packages
apt install -y curl wget gnupg lsb-release software-properties-common ufw
4

Configure Firewall

Set up UFW (Uncomplicated Firewall) to secure your VPS while allowing Netbird traffic:

Configure UFW firewall
# Enable UFW
ufw --force enable
# Allow SSH (adjust port if you've changed it)
ufw allow 22/tcp
# Allow Netbird's default ports
ufw allow 33073/udp # Management service
ufw allow 51820/udp # WireGuard (if using relay)
ufw allow 80/tcp # HTTP (for Let's Encrypt)
ufw allow 443/tcp # HTTPS
# Check firewall status
ufw status verbose
5

Install Docker and Docker Compose

Netbird runs best in containers, so we'll install Docker and Docker Compose:

Remove old Docker packages
apt-get remove docker docker-engine docker.io containerd runc
Add Docker's official GPG key and repository
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
Install Docker Engine
# Update package index
apt update
# Install Docker
apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Start and enable Docker
systemctl start docker
systemctl enable docker
# Add current user to docker group (if not root)
usermod -aG docker $USER
Verify Docker installation
docker --version
docker compose version
6

Set Up Domain (Optional but Recommended)

If you have a domain, point it to your VPS IP address. This enables SSL certificates and easier management:

DNS Configuration

Create the following DNS A records pointing to your VPS IP:

  • netbird.yourdomain.com
  • signal.yourdomain.com
  • management.yourdomain.com
Example DNS records to create
# A record: netbird.yourdomain.com -> YOUR_VPS_IP
# A record: signal.yourdomain.com -> YOUR_VPS_IP
# A record: management.yourdomain.com -> YOUR_VPS_IP
7

Download and Configure Netbird

Create a directory for Netbird and download the necessary files:

Create Netbird directory
mkdir -p /opt/netbird
cd /opt/netbird
Download Netbird infrastructure setup
# Download the latest docker-compose file
curl -fsSL https://github.com/netbirdio/netbird/releases/latest/download/docker-compose.yml.tmpl -o docker-compose.yml.tmpl
# Download the setup script
curl -fsSL https://github.com/netbirdio/netbird/releases/latest/download/setup.sh -o setup.sh
chmod +x setup.sh
8

Configure Environment Variables

Create the environment configuration. You can use the setup script or manually create the configuration:

9

Start Netbird Services

Launch the Netbird infrastructure using Docker Compose:

Generate docker-compose.yml and start services
# Generate the final docker-compose.yml from template
envsubst < docker-compose.yml.tmpl > docker-compose.yml
# Start all services
docker compose up -d
# Check service status
docker compose ps
View logs if needed
docker compose logs -f

Startup Time

The initial startup may take several minutes as Docker downloads and starts all the necessary containers. Be patient during this process.

10

Verify Installation

Check that all services are running correctly:

Check container status
docker compose ps
Test management API
# Test management API (replace with your domain/IP)
curl -k https://management.your-domain.com/api/status
# Check signal server
curl -k https://signal.your-domain.com/

Success Indicators

  • • All containers show "Up" status
  • • Management API returns a valid response
  • • Signal server responds without errors
  • • No error messages in the logs
11

Access Netbird Dashboard

Open your web browser and navigate to your Netbird management interface:

Dashboard URL:

  • • With domain: https://management.your-domain.com
  • • With IP: https://YOUR_VPS_IP

You should see the Netbird management interface where you can:

  • Create your first account
  • Add devices to your network
  • Configure access policies
  • Monitor connected peers
12

Connect Your First Device

To connect a device to your Netbird network:

13

Troubleshooting Common Issues

14

Security Considerations

Follow these security best practices to keep your Netbird installation secure:

System Security

  • Keep your system and Docker images updated regularly
  • Configure proper firewall rules - only open necessary ports
  • Always use HTTPS/SSL certificates in production

Application Security

  • Configure proper access policies in Netbird
  • Set up log monitoring for security events
  • Regularly review connected devices and users
15

Performance Optimization for RamNode

RamNode VPS instances perform well with Netbird, but consider these optimizations:

System optimizations
# Increase file descriptor limits
echo "* soft nofile 65536" >> /etc/security/limits.conf
echo "* hard nofile 65536" >> /etc/security/limits.conf
# Optimize network settings for better performance
echo 'net.core.default_qdisc=fq' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' >> /etc/sysctl.conf
sysctl -p

Monitoring Setup

Set up a simple monitoring script to ensure your Netbird instance stays healthy:

Create health check script
cat > /opt/netbird/health-check.sh << 'EOF'
#!/bin/bash
cd /opt/netbird
# Check if containers are running
if ! docker compose ps | grep -q "Up"; then
 echo "$(date): Some Netbird containers are down" >> /var/log/netbird-health.log
 docker compose up -d
fi
# Check disk space
if [ $(df / | awk 'NR==2{print 5ドル}' | sed 's/%//') -gt 85 ]; then
 echo "$(date): Disk space is running low" >> /var/log/netbird-health.log
fi
EOF
chmod +x /opt/netbird/health-check.sh
# Add to crontab for regular checks
echo "*/5 * * * * /opt/netbird/health-check.sh" | crontab -

Congratulations!

You now have a fully functional Netbird instance running on your RamNode VPS with Ubuntu 24+. This setup provides you with a secure, self-hosted VPN solution that you can use to connect all your devices securely.

The peer-to-peer nature of Netbird means that once devices authenticate, they can communicate directly without routing all traffic through your VPS, making it both efficient and cost-effective.

Remember to regularly update your system and monitor the health of your Netbird instance. With proper maintenance, this setup will provide reliable secure networking for all your devices.

For additional configuration options and advanced features, consult the official Netbird documentation at docs.netbird.io

AltStyle によって変換されたページ (->オリジナル) /