The Forest Dedicated Server Port Forwarding
All three ports required for a The Forest dedicated server: Steam communication on 8766, game traffic on 27015, and query on 27016. Includes UFW and Windows Firewall examples.
The Forest Server Port Forwarding
The Forest dedicated server requires three ports to be open and forwarded to the server machine. All three use both TCP and UDP.
Required Ports
| Port | Protocol | Purpose |
|---|---|---|
| 8766 | TCP + UDP | Steam communication (P2P relay, session) |
| 27015 | TCP + UDP | Game traffic (player connections) |
| 27016 | TCP + UDP | Steam query (server browser, ping) |
All three must be forwarded on your router and allowed through any software firewall on the host machine.
Router Port Forwarding
Log into your router's admin panel (typically 192.168.1.1 or 192.168.0.1) and add the following forwarding rules, pointing each port to the internal LAN IP of your server machine:
| External Port | Internal Port | Protocol | Destination |
|---|---|---|---|
| 8766 | 8766 | TCP + UDP | Server LAN IP |
| 27015 | 27015 | TCP + UDP | Server LAN IP |
| 27016 | 27016 | TCP + UDP | Server LAN IP |
Windows Firewall (PowerShell)
Run the following commands in an elevated PowerShell prompt:
# Steam communication
New-NetFirewallRule -DisplayName "The Forest - Steam" -Direction Inbound -Protocol TCP -LocalPort 8766 -Action Allow
New-NetFirewallRule -DisplayName "The Forest - Steam UDP" -Direction Inbound -Protocol UDP -LocalPort 8766 -Action Allow
# Game port
New-NetFirewallRule -DisplayName "The Forest - Game" -Direction Inbound -Protocol TCP -LocalPort 27015 -Action Allow
New-NetFirewallRule -DisplayName "The Forest - Game UDP" -Direction Inbound -Protocol UDP -LocalPort 27015 -Action Allow
# Query port
New-NetFirewallRule -DisplayName "The Forest - Query" -Direction Inbound -Protocol TCP -LocalPort 27016 -Action Allow
New-NetFirewallRule -DisplayName "The Forest - Query UDP" -Direction Inbound -Protocol UDP -LocalPort 27016 -Action Allow
Linux UFW
sudo ufw allow 8766/tcp
sudo ufw allow 8766/udp
sudo ufw allow 27015/tcp
sudo ufw allow 27015/udp
sudo ufw allow 27016/tcp
sudo ufw allow 27016/udp
sudo ufw reload
Confirm rules are active:
sudo ufw status verbose
Verification
Once the server is running, check that port 27015 is reachable from outside your network using a tool like canyouseeme.org. If port 8766 is blocked, players may connect directly by IP but the server won't appear reliably in the Steam browser.
Notes
- 8766 is the most commonly forgotten port. If your server shows in the browser but players get timeouts, check this one first.
- If running multiple game servers on one machine, each instance needs its own unique set of three ports — adjust
serverSteamPort,serverGamePort, andserverQueryPortinserver.cfgaccordingly.