Remote Access

Gateway binds to 127.0.0.1 by default. For remote access (gateway on a VPS, CLI on your laptop), use a secure tunnel โ€” never expose loopback bind to 0.0.0.0 directly.

Three recommended methods

1. SSH tunnel (simplest)

ssh -N -L 127.0.0.1:18789:127.0.0.1:18789 user@your-vps

# Now from your laptop:
curl http://127.0.0.1:18789/health
# โ†’ hits the gateway on your VPS

Add -f to background. Add to ~/.ssh/config for stable reconnects.

2. Tailscale (recommended for multiple machines)

# Install on both:
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up

# On the VPS, gateway already on 127.0.0.1:18789 โ€” Tailscale
# exposes the machine on its tailnet IP (100.x.x.x).

# Set on the gateway machine:
OPENVESPER_GATEWAY_HOST=100.64.0.5 vesper gateway start
# (your tailnet IP)

# From laptop:
curl http://100.64.0.5:18789/health

End-to-end encrypted via WireGuard. Works through NAT.

3. Cloudflare Tunnel (for browser-side access)

# On the VPS:
cloudflared tunnel --url http://127.0.0.1:18789

# Returns a https://xyz.trycloudflare.com URL
# Use it from anywhere (auth header recommended).

Get tunnel commands via API

curl -X POST http://127.0.0.1:18789/remote/instructions \
  -d '{"host":"my-vps.example.com","user":"alice"}'
# โ†’ { host, options: [SSH, Tailscale, Cloudflare] }

What we don't recommend

  • โŒ OPENVESPER_GATEWAY_HOST=0.0.0.0 on a public-IP VPS โ€” exposes to the whole internet
  • โŒ Reverse proxy without auth โ€” same problem
  • โŒ Cloudflare Tunnel without an Access policy if your agents have mutation tools

Source

Implementation: apps/gateway/src/remote-gateway.ts