My brother and I spent hours trying to get a server up. We got the server running, but couldn't connect to it. The server log would say "znet: OnP2PSessionConnectFail: 4".
We eventually got it to work by disabling steam on the server and client.
On the server in the ProjectZomboid64.json file, I set "-Dzomboid.steam=1" to "-Dzomboid.steam=0", then when the server started up it would say steam is not enabled.
For the client, we just added -nosteam to the launch options in steam.
Hopefully this saves others some frustration in the future.
EDIT: Also, fyi, we used linuxgsm to install the server and run it. https://linuxgsm.com/lgsm/pzserver/
It has a few typos but is pretty useful.
Ubuntu Server 16.04 64bit on Digital Ocean
EDIT2: Mods won't install without steam being enabled on the server
We're turning on steam on the server and it's downloading mods from workshop, we'll see if the client will be able to download them or what.
We're using the Mods property in the server ini file, semi-colon seperated list of Mod Ids (ex: Hydrocraft;Othermod)
EDIT3: SOLVED:
Got it! Digital Ocean servers have an anchor ip configured and that somehow messes with the zomboid server. Deleting the anchor ip resolves the issue (allows me to run server with steam enabled and mods).
For anyone with this issue in the future:
Find out your server's anchor ip
curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address
Confirm that the anchor ip exists:
ip addr list
Delete your anchor ip
ip addr delete <anchor ip + mask> dev eth0
example: ip addr delete 10.46.0.6/16 dev eth0
Confirm that anchor ip is deleted
ip addr list
Should be good to go after that!