Quick answer
A Project Zomboid dedicated server needs UDP 16261 (DefaultPort) and UDP 16262 (UDPPort, the direct connection port) open on the router and firewall. Friends add your public IPv4 address and port 16261 under Join → Favorites. The usual causes of failed joins: the ports aren't forwarded (or were forwarded as TCP), the server was launched through Steam instead of its start script, players are on a different build (Build 41 vs 42) or mod list, or your ISP uses CGNAT.
Ports
16261UDP:DefaultPortin servertest.ini. Players connect here16262UDP:UDPPort, direct connection port27015TCP:RCONPortdefault. Only if you use RCON; keep it closed otherwise
How to fix it, step by step
- Start the server the right way. Install "Project Zomboid Dedicated Server" from Steam (Tools) or SteamCMD (
app_update 380870 validate), but don't launch it through Steam. On Windows run StartServer64.bat; on Linux runstart-server.sh. If you launched it through Steam, verify the server files. - Fix the memory setting. StartServer64.bat asks for 16 GB by default. Change
-Xmsand-Xmxto what your PC has spare (for example-Xms6g -Xmx6g), or the server fails to start with memory errors. - Forward UDP 16261 and 16262. Reserve the server PC's local IP, then forward UDP 16261 and 16262 to it, and allow both in the firewall (
ufw allow 16261/udpandufw allow 16262/udpon Linux).UPnP=truein servertest.ini can do this automatically on routers that support UPnP. - Add the server by public IP. In Project Zomboid: Join → Favorites → enter your public IPv4 and port 16261, an account name and password, Save, then Join. Players on your network or a VPN use the local or VPN address.
- Match the build and mods. Everyone must be on the same build as the server. A Build 41 server needs the
legacy41branch (app_update 380870 -beta legacy41 validate) and players on that branch too. Put mod IDs inWorkshopItems=andMods=; withDoLuaChecksum=true, players whose files differ get kicked. - Check for CGNAT if outside joins still fail. If LAN works but friends outside time out with the ports forwarded, compare your router's WAN IP with your public IP. See the CGNAT guide.
Server not in the in-game browser
Public=false is the default in servertest.ini, which hides the server from the in-game browser. Set Public=true and a PublicName. Steam-enabled servers always show in Steam's own server browser. Joining through Favorites with the IP works either way.
Other things that block joins
- Stuck on the loading screen joining your own server: the saved favourite must use your real public IPv4 and UDP 16261 must be forwarded. Close the server with
quit, verify files, and restart it with the .bat file. Open=false: only accounts an admin created can join.- GOG or non-Steam players: start a
-nosteamserver; every player must also run the game with-nosteam. - Edited servertest.ini while running: run
reloadoptionsto apply it.
Test it from the outside
Your own Wi-Fi can't tell you whether friends can reach the server. The free Server Doctor check contacts your server once from the internet, the way the game does, and tells you the most likely cause. The same check runs in Discord with /fix.
No PC to host 24/7?
Project Zomboid servers need several GB of RAM and the world only runs while your PC is on. If you're behind CGNAT, port forwarding can't work at all. A hosted Project Zomboid server has its own public IP and stays online.
Related guides
- Friends can't join your 7 Days to Die server?
- Valheim server not showing up, or friends can't join?
- Enshrouded server not showing up, or friends can't join?
- Behind CGNAT? Host a game server without port forwarding.
- All guides
Sources: pzwiki.net/wiki/Dedicated_server · pzwiki.net/wiki/Server_settings
Still stuck? Get free help from real people in our Discord
Post your game, where it runs and what the check said in #help-forum. Other server hosts and the Server Doctor team can take a look. Free.