Self-hosted server environment variables

Set ports, storage paths and public addresses for a self-hosted server with environment variables read at startup.

Self-Hosted Servers · Updated November 19, 2026

The server reads these environment variables once at startup. All are optional. Restart the server after changing one.

Networking

VariableDefaultSets
TCP_PORT8088Port for chat, files and the voice handshake
UDP_PORT7070Port for voice and video. WEBRTC_UDP_PORT also works and wins if both are set.
WEBRTC_TCP_PORTsame as UDP_PORTTCP voice fallback for networks that block UDP. 0 turns it off.
PUBLIC_IPdetectedPublic IPv4, only when inbound and outbound addresses differ. See custom public IP.
PUBLIC_IPV6detectedIPv6 address members connect to. Set an address to pin it, or off. See IPv6, CGNAT and Starlink.
TURN_SERVER_URL, TURN_USERNAME, TURN_PASSWORDunsetA TURN relay you run, for members who cannot connect directly

Storage

VariableDefaultHolds
DATA_DIRdata next to the binary, or the folder chosen at installDatabases, logs and server state. Back this up.
FILES_DIR<DATA_DIR>/filesUploaded files
BACKUPS_DIR<DATA_DIR>/backupsAutomatic 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 with sudo systemctl edit gamevox-self-hosted-server. See Linux with systemd.
  • Docker. Use the environment: block in docker-compose.yml. See Docker.
  • Windows service. Edit the Environment value under HKLM\SYSTEM\CurrentControlSet\Services\GameVoxServer, then restart the service. Leave SERVICE_NAME and SERVICE_DISPLAY_NAME alone. 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.

Still need help?

Email our support team and a person will get back to you.

Email support@gamevox.com