Since it is a socket error, there has to be some issue with a firewall blocking it, either on the server or the router. Are you forwarding BOTH UDP/TCP for 25565 on the router and have both open on the server? Since you can connect locally, I would think the server is good and there is a router problem.
from the terminal just to make sure there isn’t an issue there. Do you have IPv6 turned off?
Just found this too…
Sorry to reedit…this one is bugging me. Found someone with similar issue and they posted this:
Alright. I have finally got this working. The problem was the modem from the ISP. My router sits downstream from the modem, in bridge mode, but for whatever reason bridge mode doesn’t actually bridge unless you also turn off NAT manually. IDK why the default setting for bridge mode is double NAT and no pass through but this is centurylink at its finest.