OneLobby docs

Run your own OneLobby server

You get a lobby server, a relay for players behind strict networks, and automatic HTTPS, on one small machine. A 1 vCPU / 1 GB VM or a Raspberry Pi 4 is enough.

This is the advanced path. If you only need a lobby server and no relay, EASY_SERVER.md gets you one on a free host in a few clicks.

Five steps

  1. Get a machine and a name. Any Linux box with a public IP and Docker (with the compose plugin). Point a DNS record (for example lobby.example.com) at it.
  2. Open the ports in the machine's firewall and your cloud's security group (table below).
  3. Configure. From this deploy/ directory:
    cp .env.example .env
    Edit .env: set LOBBY_DOMAIN, ACME_EMAIL, TURN_EXTERNAL_IP (your public IP), and a fresh secret with openssl rand -hex 32 for TURN_SECRET.
  4. Start it.
    docker compose up -d
    Caddy fetches a certificate on first start (give it a minute; ports 80 and 443 must be reachable).
  5. Point your game at it. Set the game's lobby_server to wss://lobby.example.com/ws. The server accepts WebSockets on / as well, so wss://lobby.example.com also works; the recipes and examples use the /ws form.

Ports

Port Protocol Who What
80 TCP Caddy Certificate challenge and redirect to HTTPS
443 TCP (and UDP) Caddy wss:// lobby signaling, /healthz, optional Godot web build
3478 UDP and TCP coturn TURN relay
5349 TCP coturn TURN over TLS (turns:), for networks that only allow TCP
49160-49400 UDP coturn Relay range, one port per relayed player
8080 TCP onelobby-server Internal only. Not published to the internet

TURN over TLS is on 5349 by default because Caddy owns 443. If you want turns: on 443 as well (some hotel and office networks allow nothing else), give the machine two public IPs. Bind Caddy to one with ports: "IP1:443:443" in compose.yaml, set TURN_TLS_PORT=443 and listening-ip=IP2 for coturn. Most games are fine without this.

Smoke test

On the machine (an Ubuntu VM is the tested target), as root so it can block UDP for the TCP/TLS checks:

sudo deploy/scripts/smoke.sh

It checks that https://<your domain>/healthz answers 200 with a valid certificate, that a TURN allocation works over UDP, and that allocations still work over TCP and TLS with UDP to the relay blocked. Every line starts with ok or FAIL.

To check only the credential maths (no server needed): node deploy/scripts/turn-creds-check.mjs.

Running without Docker

Download the onelobby-server binary for your platform from the releases page, then follow the comments at the top of onelobby-server.service (a systemd unit). Install coturn from your package manager, copy turnserver.conf to /etc/turnserver.conf, and pass the secret, realm, external IP and certificate on the coturn command line as compose.yaml does. You still want Caddy (or nginx) in front for TLS.

Raspberry Pi notes

Good to know

This page is generated from the source on GitHub, which is always the latest version.