What ports does Project Zomboid (Dedicated Server) use?
Project Zomboid (Dedicated Server) listens on UDP 16261-16262. That is what has to reach the machine you're configuring: the port forward on its router, and what the firewall prompt on first launch is asking for.
UDP 16261-16262(2 ports) — inbound, to the machine running the server.
If that machine is your own PC, you can skip the port forward: in Checkpoint64, Checkpoint Connect shares the running server with your team, and they join directly when they can and through a relay when they can't.
Ports are the half of hosting that happens on the router. The other half is on disk — the rule set this server reads at startup, kept in its config folder, which nothing else holds a copy of. Checkpoint64 backs that folder up automatically and keeps every version, so rebuilding the box doesn't mean rebuilding the config. And if keeping it running stops being worth it, a small group can pass one world between them instead: the dedicated server alternative guide walks through it.