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
| Port | Protocol | What it carries | If it is missing |
|---|---|---|---|
| 443 (and 80 for certificates) | TCP | The site, the API and the WebSocket, to your reverse proxy | Nothing loads |
| 50000–50050 | UDP | Voice, video and screen sharing, straight to the server | Chat works, calls say “No media connection” |
| 3479 | UDP and TCP | The built-in TURN relay for members whose network blocks UDP | Voice 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:
| Destination | When | Why | Switch off |
|---|---|---|---|
stun.l.google.com, stun.cloudflare.com (UDP 19302, 3478) | At startup and every 10 minutes, while WEBRTC_NAT_1TO1_IP is empty | Learn the server's public IPv4 address | WEBRTC_AUTO_ANNOUNCE=false and set WEBRTC_NAT_1TO1_IP |
api.github.com (TCP 443) | Every 30 minutes | Check for a newer release | UPDATE_CHECK_ENABLED=false |
time.cloudflare.com, pool.ntp.org (UDP 123) | Every 6 hours | Compare the clock for the setup checks | CLOCK_CHECK_ENABLED=false |
| Your mail server | Only when mail is sent | Address confirmation, password reset | Leave SMTP_HOST empty |
| Browser push services | When a notification is due | Encrypted Web Push | PUSH_ENABLED=false |
| Linked websites | When a message with a link is posted | Link previews | LINK_PREVIEWS_ENABLED=false |
ghcr.io, tuf-repo-cdn.sigstore.dev | When you pull or update | Images, and the updater's signature check | Update by hand |
None of these carries member data, and none needs inbound access. Every connection, with its settings: Network ports.