Project Zomboid Server Port Closed: How to Fix It
If your Project Zomboid server shows a port closed error, the fix is to forward the correct ports (default 16261 UDP and 16262 UDP) on your router and configure your firewall to allow them. This article explains the exact steps, common pitfalls, and how to verify the fix.
Background: Why Project Zomboid Needs Ports
Project Zomboid uses a peer-to-peer (P2P) connection model for multiplayer, even when you host a dedicated server. The server listens on UDP port 16261 for game traffic and 16262 for Steam query responses. When you see a “port closed� message in the server console or on the Steam server browser, it means the port is not reachable from the internet—so other players can’t connect.
This happens because your router’s firewall blocks unsolicited incoming traffic by default. Port forwarding tells the router to send traffic on a specific port to your server’s local IP address.
How Port Forwarding Works
Port forwarding is a router setting that maps an external port (the one players connect to) to an internal IP and port (your server machine). For Project Zomboid, you need to forward both UDP 16261 and UDP 16262 to the local IP of the computer running the server.
Here’s a step-by-step guide:
- Find your server’s local IP address (e.g., 192.168.1.100). On Windows, open Command Prompt and type
ipconfig; look for “IPv4 Address�. - Log into your router’s admin panel. Usually this is at
192.168.1.1or192.168.0.1—check your router’s label or manual. - Find the “Port Forwarding� or “Virtual Server� section (names vary by router).
- Create two rules: one for UDP 16261 and one for UDP 16262, both pointing to your server’s local IP.
- Save the settings and restart the router if prompted.
After forwarding, verify the port is open using an online port checker (search “port checker� and enter 16261). If it shows open, your server should be reachable.
Common Causes of Port Closed Errors
Even after forwarding, you might still see a closed port. Here are the usual culprits:
- Wrong IP address: You forwarded to the wrong local IP. Double-check that the IP hasn’t changed (set a static IP).
- Firewall blocking: Windows Firewall or antivirus software can block incoming connections. You need to allow UDP 16261 and 16262 for the server executable.
- Double NAT: If your ISP provides a modem/router combo and you have your own router, you might have two NATs. Forward ports on both devices, or put your router in bridge mode.
- Carrier-grade NAT (CGNAT): Some ISPs don’t give you a public IP. Check your WAN IP—if it’s in the range 100.64.0.0/10, you have CGNAT and port forwarding won’t work without a VPN or a static IP from your ISP.
- UDP vs TCP: Project Zomboid uses UDP only. If you forwarded TCP by mistake, it won’t work.
How to Fix Firewall Issues on Windows
If your router is correctly forwarded, the next step is to check Windows Firewall. Here’s how:
- Open Control Panel → Windows Defender Firewall → Advanced settings.
- Click Inbound Rules → New Rule.
- Choose Port, then UDP and enter
16261,16262. - Select Allow the connection and apply to all profiles.
- Name the rule (e.g., “Project Zomboid Server�) and finish.
If you have a third-party antivirus, check its firewall settings as well—some block unknown applications by default.
Using a Static IP for Your Server
Your router assigns IP addresses dynamically via DHCP. If your server’s IP changes, your port forward rule breaks. To avoid this, set a static IP:
- In Windows, go to Network Settings → Change adapter options → right-click your adapter → Properties → Internet Protocol Version 4 (TCP/IPv4).
- Use the same IP you forwarded, with subnet mask 255.255.255.0 and your router’s IP as the gateway and DNS.
- Alternatively, set a DHCP reservation in your router’s admin panel, which ties the IP to your server’s MAC address.
Alternatives: VPN and Hamachi
If port forwarding is impossible (CGNAT, apartment network, etc.), you can use a virtual LAN service like Hamachi or ZeroTier. These create a virtual network where players connect to your “virtual IP� instead of your public IP. This bypasses port forwarding entirely. Note that all players must install the same VPN software and join your network.
Frequently Asked Questions
Why does my port checker say closed even after forwarding?
Most likely the firewall is still blocking, or you forwarded the wrong IP. Also, some port checkers test TCP by default—make sure you test UDP. If you’re testing from the same network as the server, the test might fail due to NAT loopback; try from a different network (e.g., phone on cellular data).
Do I need to forward both 16261 and 16262?
Yes. 16261 is the main game port, and 16262 is used for Steam server queries. Without 16262, the server may not appear in the Steam server browser, and players might not be able to join.
Can I change the default port?
Yes, you can change the port in the server’s servertest.ini file (or your server’s name). But then you must forward the new port instead. Make sure to update your port forward rules accordingly.
What if my router doesn’t support port forwarding?
Some ISP-provided routers lack this feature. You can try putting your router in bridge mode, but if that’s not possible, use a VPN solution like Hamachi.
Why can I connect locally but friends can’t?
That’s the classic sign of a port forwarding issue. Local connections stay inside your network, so they don’t need port forwarding. The fact that friends can’t connect confirms that the port is not reachable from the internet.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.