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.
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.
Before beginning the Netbird installation, ensure you have the following:
First, connect to your RamNode VPS via SSH and update the system:
ssh root@your-vps-ipapt update && apt upgrade -yapt install -y curl wget gnupg lsb-release software-properties-common ufwSet up UFW (Uncomplicated Firewall) to secure your VPS while allowing Netbird traffic:
# 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 verboseNetbird runs best in containers, so we'll install Docker and Docker Compose:
apt-get remove docker docker-engine docker.io containerd runc# 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# 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 $USERdocker --version
docker compose versionIf 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.comsignal.yourdomain.commanagement.yourdomain.com# A record: netbird.yourdomain.com -> YOUR_VPS_IP
# A record: signal.yourdomain.com -> YOUR_VPS_IP
# A record: management.yourdomain.com -> YOUR_VPS_IPCreate a directory for Netbird and download the necessary files:
mkdir -p /opt/netbird
cd /opt/netbird# 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.shCreate the environment configuration. You can use the setup script or manually create the configuration:
Launch the Netbird infrastructure using Docker Compose:
# 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 psdocker compose logs -fStartup Time
The initial startup may take several minutes as Docker downloads and starts all the necessary containers. Be patient during this process.
Check that all services are running correctly:
docker compose ps# 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
Open your web browser and navigate to your Netbird management interface:
Dashboard URL:
https://management.your-domain.comhttps://YOUR_VPS_IPYou should see the Netbird management interface where you can:
To connect a device to your Netbird network:
Follow these security best practices to keep your Netbird installation secure:
RamNode VPS instances perform well with Netbird, but consider these 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 -pSet up a simple monitoring script to ensure your Netbird instance stays healthy:
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 -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