Ports and the firewall

Three things from the internet, and nothing else. This page says what each port does, what breaks without it, and which ports must stay closed.

What to open

PortProtocolWhat it carriesIf it is missing
443 (and 80 for certificates)TCPThe site, the API and the WebSocket, to your reverse proxyNothing loads
50000–50050UDPVoice, video and screen sharing, straight to the serverChat works, calls say “No media connection”
3479UDP and TCPThe built-in TURN relay for members whose network blocks UDPVoice works for most, but not behind strict firewalls or VPNs

Never open 8080 (the app port, published on 127.0.0.1 only), 5432 (PostgreSQL) or 8333 (SeaweedFS). They exist only inside the Docker network or on loopback.

Why UDP, and why a range

Browsers send voice and video as UDP packets directly to the server; the reverse proxy does not carry them. In the default mode every call shares the first port of the range (WEBRTC_UDP_MUX_PORT), so forwarding just that port would work today. Forward the whole range anyway: the legacy mode (WEBRTC_UDP_MUX_PORT=0, one port per peer) uses all of it, and Compose publishes all of it.

The relay on 3479

Some networks block UDP entirely: company networks, some VPNs, browsers with WebRTC protection. For them the built-in TURN relay carries the media over a single port, also over TCP. It runs by default while no external TURN server is configured (WEBRTC_TURN_URLS empty). One port serves both protocols, so a router that asks for a single protocol can use "both".

On a VPS: two firewalls

The machine's own firewall:

sudo ufw allow 80,443/tcp && sudo ufw allow 50000:50050/udp && sudo ufw allow 3479

3479 without a protocol opens UDP and TCP. Docker publishes ports around ufw on some setups; if a port stays closed anyway, check sudo iptables -L DOCKER-USER. The provider's firewall (security group) is a second, separate one: open the same ports there.

At home: the router

Create port forwards to the machine that runs Mnema Talk. Behind a router has the copy-paste table and the CGNAT check.

What the server connects to

The server and its sidecars start a few connections of their own. Allow them in a strict egress filter, or switch them off:

DestinationWhenWhySwitch off
stun.l.google.com, stun.cloudflare.com (UDP 19302, 3478)At startup and every 10 minutes, while WEBRTC_NAT_1TO1_IP is emptyLearn the server's public IPv4 addressWEBRTC_AUTO_ANNOUNCE=false and set WEBRTC_NAT_1TO1_IP
api.github.com (TCP 443)Every 30 minutesCheck for a newer releaseUPDATE_CHECK_ENABLED=false
time.cloudflare.com, pool.ntp.org (UDP 123)Every 6 hoursCompare the clock for the setup checksCLOCK_CHECK_ENABLED=false
Your mail serverOnly when mail is sentAddress confirmation, password resetLeave SMTP_HOST empty
Browser push servicesWhen a notification is dueEncrypted Web PushPUSH_ENABLED=false
Linked websitesWhen a message with a link is postedLink previewsLINK_PREVIEWS_ENABLED=false
ghcr.io, tuf-repo-cdn.sigstore.devWhen you pull or updateImages, and the updater's signature checkUpdate by hand

None of these carries member data, and none needs inbound access. Every connection, with its settings: Network ports.

Something wrong on this page? Tell us.