Deployment

Production deployment guide for the HashRelay server and client.

Server — Recommended Specs

SizeClientsMonthly Cost (est.)
1 vCPU / 512 MB≤ 10~$4 USD/mo
2 vCPU / 2 GB≤ 100~$12 USD/mo
4 vCPU / 8 GB≤ 1000~$40 USD/mo
Use providers with BGP anycast or CN2 routes for China↔overseas tunnels.

Server — One-Line Install (Recommended)

The installer downloads hr-server, writes /etc/hash-relay/server.toml, installs the web UI to /usr/share/hash-relay/web, and registers a service (systemd, or procd on OpenWrt).

# Interactive install (prompts for ports, database URL, JWT secret)
curl -fsSL https://hashrelay.net/releases/scripts/install-server.sh | sudo sh

# Non-interactive (override defaults via env vars)
curl -fsSL https://hashrelay.net/releases/scripts/install-server.sh \
  | sudo env TCP_PORT=8555 QUIC_PORT=9555 API_PORT=8080 sh

Managing the systemd Service

The installer creates and enables a hash-relay-serverservice running as the hashrelay user with ExecStart=/usr/local/bin/hr-server --config /etc/hash-relay/server.toml.

sudo systemctl status hash-relay-server
sudo systemctl restart hash-relay-server
sudo journalctl -u hash-relay-server -f

Updating

# Server
curl -fsSL https://hashrelay.net/releases/scripts/update-server.sh | sudo sh
# Client
curl -fsSL https://hashrelay.net/releases/scripts/update-client.sh | sudo sh
# Web admin UI
curl -fsSL https://hashrelay.net/releases/scripts/update-web.sh | sudo sh

Client — Linux

Create a client node on the server first (Web UI → Client Nodes). Replace every YOUR_* placeholder below:

# Create a client node on the server first (Web UI → Client Nodes).
# Replace YOUR_* values below with your own before running.

curl -fsSL https://hashrelay.net/releases/scripts/install-client.sh | \
  sudo env \
    SERVER_ADDR=YOUR_SERVER_IP \
    TCP_PORT=8555 \
    QUIC_PORT=9555 \
    CLIENT_ID=YOUR_CLIENT_ID \
    TOKEN=YOUR_ACCESS_TOKEN \
    sh

# OpenWrt / already root: omit sudo — pipe to "env ... sh" instead

Or install interactively (the script prompts for each value):

# Interactive install — the script prompts for each value.
curl -fsSL https://hashrelay.net/releases/scripts/install-client.sh | sudo sh

Or install first, edit config, then restart:

# Install first, edit config, then restart:
curl -fsSL https://hashrelay.net/releases/scripts/install-client.sh | sudo sh
# OpenWrt / already root: omit sudo on the line above

# Edit /etc/hash-relay/client.toml — set server_addr, tcp_port, quic_port, client_id, token
sudo nano /etc/hash-relay/client.toml

# Restart — Linux (systemd):
sudo systemctl restart hash-relay-client

# Restart — OpenWrt (procd):
/etc/init.d/hash-relay-client restart
sudo systemctl status hash-relay-client
sudo journalctl -u hash-relay-client -f

Client — Windows

# Download hr-client.exe from the Downloads page, then run with your config
.\hr-client.exe --config client.toml

File Locations

PathPurpose
/usr/local/bin/hr-serverServer binary (systemd installs)
/etc/hash-relay/server.tomlServer config
/etc/hash-relay/client.tomlClient config
/var/lib/hash-relayData (SQLite DB, self-signed certs)
/var/log/hash-relayLog files
/usr/share/hash-relay/webWeb admin UI static files

Firewall Rules

# Server: allow inbound
ufw allow 8555/tcp   # tunnel (TCP/TLS)
ufw allow 9555/udp   # tunnel (QUIC)
ufw allow 8080/tcp   # admin API + web UI (restrict in production)

Uninstall

curl -fsSL https://hashrelay.net/releases/scripts/uninstall-server.sh | sudo sh
curl -fsSL https://hashrelay.net/releases/scripts/uninstall-client.sh | sudo sh