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, the database URL, and the JWT secret.

Linux — sudo asks for your password:

curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-server.sh | sudo sh

OpenWrt / iStoreOS, or a shell that is already root:

curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-server.sh | sh

Non-interactive install — override defaults with environment variables:

Linux — sudo asks for your password:

curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-server.sh | sudo env \
  TCP_PORT=8555 \
  QUIC_PORT=9555 \
  API_PORT=8080 \
  sh

OpenWrt / iStoreOS, or a shell that is already root:

curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-server.sh | 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

Linux — sudo asks for your password:

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

OpenWrt / iStoreOS, or a shell that is already root:

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

Client — Linux

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

Linux — sudo asks for your password:

curl -fsSL https://downloads.hashrelay.net/hashrelay/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 / iStoreOS, or a shell that is already root:

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

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

Linux — sudo asks for your password:

curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-client.sh | sudo sh

OpenWrt / iStoreOS, or a shell that is already root:

curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-client.sh | sh

Or install first, edit config, then restart:

Linux — sudo asks for your password:

curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-client.sh | sudo sh

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

OpenWrt / iStoreOS, or a shell that is already root:

curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-client.sh | sh

# Edit /etc/hash-relay/client.toml — set server_addr, tcp_port, quic_port, client_id, token
# vi /etc/hash-relay/client.toml
# /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

Linux — sudo asks for your password:

# Server
curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/uninstall-server.sh | sudo sh
# Client
curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/uninstall-client.sh | sudo sh

OpenWrt / iStoreOS, or a shell that is already root:

# Server
curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/uninstall-server.sh | sh
# Client
curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/uninstall-client.sh | sh