Special Offers: Up to 75% OFF on Hostinger & High-RAM Contabo Cloud VPS available this month.Compare Plans

How to Connect Multiple VPS Servers with Private WireGuard Mesh Network

Alex Vance
Alex VanceCloud Infrastructure Architect
November 21, 2026
•
16 min read
•
4.9 / 5.0
Transparency Notice: This article contains affiliate links to hosting providers like Hostinger and Contabo. If you purchase through our links, we may earn a commission at zero extra cost to you. We only recommend products we personally benchmark and test. Read full disclosure.
How to Connect Multiple VPS Servers with Private WireGuard Mesh Network

Hostinger vs. Contabo: Full Specifications Breakdown

Data verified from our lab benchmarks • Updated for 2026

Feature / Metric
HostingerEditor's Choice UI
ContaboMax RAM Value
Starting Price$2.99 / month (Web) | $4.99 / mo (VPS)$5.50 / month (Cloud VPS S)
vCPU Cores1 to 8 vCPU (Dedicated resources)4 to 12 vCPU (High Core Count)
RAM Memory4 GB to 32 GB6 GB to 64 GB (Gigantic RAM)
Storage Technology50 GB – 400 GB NVMe SSD50 GB NVMe or 300 GB SSD
Traffic / Bandwidth4 TB to 32 TB32 TB Outgoing + Unlimited In
Control Panel & UIhPanel (Ultra Modern & Easy)cPanel, Plesk, Webmin, or CLI
Customer Support24/7 Live Chat & AI Support (Multi-lingual)Email Ticket Support (German Business Hours)
Best ForBloggers, WordPress Sites & Devs wanting easy UIHeavy Database, Docker, Game Servers & SysAdmins
Money-Back Guarantee30-Day Money-Back Guarantee14-Day EU Statutory Cancellation
Official LinksVisit HostingerVisit Contabo
Quick Answer & Key Takeaways
Updated November 21, 2026 • Lab Score 4.9/5.0

Stop exposing private databases and backend APIs to the public internet. Learn how to connect multiple VPS nodes securely over an encrypted WireGuard mesh tunnel.

  • Isolates backend databases (Postgres, MySQL, Redis) completely from the public internet
  • Seamlessly connects servers across different providers (e.g. Hostinger web node + Contabo storage node)
  • Zero performance tax: WireGuard runs directly in the Linux kernel with sub-1ms crypto latency

The Danger of Public-Facing Backend Services

In distributed multi-server architectures, web application servers frequently need to communicate with dedicated database nodes, Redis caches, or backup storage targets. A dangerous anti-pattern is binding MySQL (port 3306) or PostgreSQL (port 5432) to 0.0.0.0 and allowing public internet connections secured only by a password.

Attackers continually scan cloud ranges for open database ports. A single brute-force breach or leaked credential exposes your entire customer database. Furthermore, transmitting unencrypted database queries across the public web is vulnerable to interception.

WireGuard solves this by creating an encrypted, private point-to-point virtual network (VPN) between your servers. You can connect a Hostinger KVM VPS acting as your public frontend web server with a Contabo Storage VPS acting as your private database warehouse over internal, non-routable IP addresses (e.g., 10.0.0.1 and 10.0.0.2).

Network Topology Architecture

  • Node A (Frontend Web Server - Hostinger KVM): Public IP 195.35.12.84 | WireGuard Internal IP 10.0.0.1
  • Node B (Backend Database - Contabo VPS): Public IP 161.97.142.50 | WireGuard Internal IP 10.0.0.2

Step 1: Install WireGuard on Both Nodes

Run the following commands on both Server A and Server B:

sudo apt update && sudo apt install -y wireguard wireguard-tools

Step 2: Generate Cryptographic Keys on Node A

On Node A (Hostinger):

cd /etc/wireguard
umask 077
wg genkey | tee privatekey | wg pubkey > publickey
cat privatekey
cat publickey

Step 3: Generate Cryptographic Keys on Node B

On Node B (Contabo):

cd /etc/wireguard
umask 077
wg genkey | tee privatekey | wg pubkey > publickey
cat privatekey
cat publickey

Step 4: Configure Node A (/etc/wireguard/wg0.conf)

Create the tunnel configuration on Node A:

sudo nano /etc/wireguard/wg0.conf
[Interface]
Address = 10.0.0.1/24
ListenPort = 51820
PrivateKey = NODE_A_PRIVATE_KEY

[Peer]
# Node B (Contabo)
PublicKey = NODE_B_PUBLIC_KEY
Endpoint = 161.97.142.50:51820
AllowedIPs = 10.0.0.2/32
PersistentKeepalive = 25

Step 5: Configure Node B (/etc/wireguard/wg0.conf)

Create the tunnel configuration on Node B:

sudo nano /etc/wireguard/wg0.conf
[Interface]
Address = 10.0.0.2/24
ListenPort = 51820
PrivateKey = NODE_B_PRIVATE_KEY

[Peer]
# Node A (Hostinger)
PublicKey = NODE_A_PUBLIC_KEY
Endpoint = 195.35.12.84:51820
AllowedIPs = 10.0.0.1/32
PersistentKeepalive = 25

Step 6: Firewall Rules & Starting the Tunnel

Open UDP port 51820 on both servers' UFW firewalls:

sudo ufw allow 51820/udp
sudo systemctl enable --now wg-quick@wg0

Step 7: Verifying Encrypted Connectivity

On Node A, test pinging Node B across the private WireGuard tunnel:

ping 10.0.0.2

Check the active tunnel telemetry with the wg command:

sudo wg
# Output confirms:
# interface: wg0
# peer: [Node B Public Key]
# endpoint: 161.97.142.50:51820
# latest handshake: 14 seconds ago
# transfer: 1.42 MiB received, 2.18 MiB sent

Step 8: Binding Database to Private IP Only

Now, on your backend Contabo database node, edit PostgreSQL or MySQL settings to listen only on the private WireGuard interface:

# /etc/postgresql/16/main/postgresql.conf
listen_addresses = '10.0.0.2, localhost'

Restart PostgreSQL. Now, your database is 100% invisible to the public internet, accessible solely by your frontend web server through military-grade encryption.

Summary

Using WireGuard site-to-site networking allows you to combine the strengths of multiple providers—such as Hostinger's fast web nodes with Contabo's high-capacity storage nodes—in a unified, hyper-secure private cloud.

Video Walkthrough & Official References

How to Set Up Your Own WireGuard VPN Server on Ubuntu • ZacsTech

Watch on YouTube

Editorial Verdict: Pros & Cons

What We Love (Pros)

  • Isolates backend databases (Postgres, MySQL, Redis) completely from the public internet
  • Seamlessly connects servers across different providers (e.g. Hostinger web node + Contabo storage node)
  • Zero performance tax: WireGuard runs directly in the Linux kernel with sub-1ms crypto latency

Drawbacks (Cons)

  • Requires manual key exchange between peer configuration files unless using an overlay orchestrator
Alex Vance

Written by Alex Vance

Cloud Infrastructure Architect

Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.

Recommended Next Reads