PeerSend
PeerSendHome

Build Your Own Tunnel Server

If you run your own tunnel server instead of using the public one, PeerSend devices can stay connected and exchange files even when they are not on the same network. The guide below is based on an Ubuntu server setup.

Installation

Requirements

Server

  • Ubuntu 20.04+ (24.04 recommended)
  • Public ports: 80, 443, app port (default 8080), and TCP/UDP port ranges used for tunneling
  • Python 3.10+, Nginx (installed automatically by the script)
  • Domain and DNS configuration (wildcard subdomain support requires *.example.com)

Key points

  • The tunnel server does not store files; it only bridges connections between devices.
  • Preparing your domain and wildcard DNS helps connect multiple devices more reliably.
  • Token whitelists and dashboard accounts let you control who can access the server.

1. Server installation (Ubuntu/Debian)

The Tunneler APT repository supports package management and automatic updates. Register the signing key and add the repository list to trust the source. This only needs to be done once.

# GPG public key
curl -fsSL https://rhkr8521.github.io/Tunneler/tunneler-apt-public.key | sudo gpg --dearmor -o /usr/share/keyrings/tunneler-archive-keyring.gpg

# Add APT repository list
echo "deb [signed-by=/usr/share/keyrings/tunneler-archive-keyring.gpg] https://rhkr8521.github.io/Tunneler/repo stable main" | sudo tee /etc/apt/sources.list.d/tunneler.list

# Update APT
sudo apt update

2. Install the server package

sudo apt install tunneler-server

Main configuration inputs

3. Verify installation

Dashboard access

http(s)://<domain>/dashboard

Service status

sudo systemctl status tunneler-server -l

Live logs

sudo journalctl -u tunneler-server -f

Health check

curl -fsS \
  -H "Authorization: Bearer <CLIENT_TOKEN>" \
  "http://<DOMAIN>/_health" | jq .