Set a custom public IP for a self-hosted server
Use PUBLIC_IP only when members must reach your server on a different IPv4 address than the one it sends traffic from.
Leave PUBLIC_IP unset unless inbound and outbound traffic use different IPv4 addresses. GameVox detects your public IP from the server's connection to the cloud, which works for most homes and VPS hosts.
When to set it
- Networks with separate inbound and outbound gateways
- Cloud setups with a NAT gateway outbound and an elastic IP or load balancer inbound
- Multi-IP or multi-homed hosts with asymmetric routing
- Docker in bridge mode, when voice fails because the detected address is wrong
If nothing reaches your server at all, PUBLIC_IP will not help. Check your port forwarding, or see CGNAT and Starlink.
The value must be a public IPv4 address with no port or scheme. Private (192.168.x.x, 10.x.x.x, 172.16.x.x to 172.31.x.x), loopback and link-local addresses are rejected, and the server falls back to detection.
Set it
Docker Compose, in the environment: block:
environment:
DATA_DIR: /app/data
TCP_PORT: *tcp_port
UDP_PORT: *udp_port
PUBLIC_IP: 198.51.100.25 Docker run: add -e PUBLIC_IP=198.51.100.25.
systemd:
sudo systemctl edit gamevox-self-hosted-server
# add:
# [Service]
# Environment=PUBLIC_IP=198.51.100.25
sudo systemctl restart gamevox-self-hosted-server How GameVox checks it
Before pointing members at the address, the GameVox cloud connects to it on your TCP port and checks that the /health reply comes from your server. Only then does it switch DNS to that address. It checks again from time to time. If a check fails, GameVox keeps using the detected address.
To go back, remove PUBLIC_IP and restart the server.