Direct answer
First confirm the server works locally. Then give the server computer a stable LAN address, create a router port-forward rule from the internet-facing port to that LAN address and the server's server-port, allow the connection through the host firewall, and test from outside your home network.
Before touching the router
- The server must be running and reachable by
localhoston the host. - Another device on the same LAN should be able to join using the server's private IP.
server-ip=should normally be blank.- Confirm the configured
server-port; the Java default is25565.
Create the router rule
Router interfaces differ, but the rule normally needs the server PC's LAN IPv4 address and the Minecraft server port. For standard Java gameplay on the default port, forward TCP port 25565 to the same port on the server computer. If you changed server-port, forward that value instead.
Test from outside the network
Do not rely only on trying your public IP from inside the same Wi-Fi. Use a phone hotspot or a friend on another connection. Keep the server running during the test; many port-checking tools report a port as closed when no process is listening.
If everything looks correct but the port is still closed
Check whether your ISP uses carrier-grade NAT (CGNAT). Compare the WAN/Internet IPv4 shown by your router with the public IPv4 reported by an external “what is my IP” service. If they do not represent the same public endpoint, or the router receives an address from a CGNAT/private range, ordinary inbound port forwarding may not be available.
Options include asking the ISP for a public IPv4 address, using a trusted tunneling/VPN solution designed for game traffic, or hosting the server on a provider with reachable networking.
Security basics
Expose only the port you actually need, keep the server and plugins updated, use a whitelist for private servers, and keep backups. Do not disable your entire firewall just to make one game port work.
- Use a second LAN device first; if that works but an external phone hotspot cannot connect, inspect router NAT and host firewall. A local localhost test does not verify public reachability.
- For standard Java Edition, route TCP to the actual server-port and reserve the server’s LAN IPv4. If Velocity is the public entry point, forward to the proxy and keep backends private.
- Compare your router’s WAN IP with a public-IP lookup. CGNAT or double NAT can prevent ordinary forwarding even when a rule appears correct.
Official references
These references were checked while preparing this guide. Version-specific behavior can change, so use the project documentation for your exact release when a detail differs.
Related guides
Help us improve this article
Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.