Self-hosted server environment variables
Set ports, storage paths and public addresses for a self-hosted server with environment variables read at startup.
The server reads these environment variables once at startup. All are optional. Restart the server after changing one.
Networking
| Variable | Default | Sets |
|---|---|---|
TCP_PORT | 8088 | Port for chat, files and the voice handshake |
UDP_PORT | 7070 | Port for voice and video. WEBRTC_UDP_PORT also works and wins if both are set. |
WEBRTC_TCP_PORT | same as UDP_PORT | TCP voice fallback for networks that block UDP. 0 turns it off. |
PUBLIC_IP | detected | Public IPv4, only when inbound and outbound addresses differ. See custom public IP. |
PUBLIC_IPV6 | detected | IPv6 address members connect to. Set an address to pin it, or off. See IPv6, CGNAT and Starlink. |
TURN_SERVER_URL, TURN_USERNAME, TURN_PASSWORD | unset | A TURN relay you run, for members who cannot connect directly |
Storage
| Variable | Default | Holds |
|---|---|---|
DATA_DIR | data next to the binary, or the folder chosen at install | Databases, logs and server state. Back this up. |
FILES_DIR | <DATA_DIR>/files | Uploaded files |
BACKUPS_DIR | <DATA_DIR>/backups | Automatic and manual backups |
Logs always go to <DATA_DIR>/logs.
How to set them
Windows start script, saved as start-gamevox.bat next to the .exe:
@echo off
set TCP_PORT=9090
set FILES_DIR=D:\gamevox-files
gamevox-self-hosted-server.exe
pause Linux start script, saved as start-gamevox.sh and made executable with chmod +x:
#!/bin/bash
export TCP_PORT=9090
export FILES_DIR=/mnt/storage/gamevox-files
./gamevox-self-hosted-server - systemd service. Add
Environment=lines withsudo systemctl edit gamevox-self-hosted-server. See Linux with systemd. - Docker. Use the
environment:block indocker-compose.yml. See Docker. - Windows service. Edit the
Environmentvalue underHKLM\SYSTEM\CurrentControlSet\Services\GameVoxServer, then restart the service. LeaveSERVICE_NAMEandSERVICE_DISPLAY_NAMEalone. The installer sets them.
Check what is in use
The server writes its paths, ports and addresses to the log at every start, and to GENERATED-README.txt in the data folder. Look there first if a setting seems to have no effect.
TURN example
TURN_SERVER_URL=turn:turn.example.com:3478,turn:turn.example.com:3478?transport=tcp
TURN_USERNAME=gamevox
TURN_PASSWORD=your-secret Separate relays with commas. Clients try them in order. Every member's app receives these credentials, so use a password you use nowhere else. Relayed voice uses about 50 to 60 kbit/s per member on your relay, and video much more.