How to port forward a Minecraft server
Your router blocks visitors from the internet, which keeps you safe. Port forwarding is one rule that tells it: "Minecraft players knocking on port 25565 should go to this PC." It takes about five minutes.
Using HostCraft? Its Network tab fills in your real addresses and can try to do this automatically (UPnP).
1. Find your PC's local address and your router's address
Press Win + R, type cmd, press Enter, then type ipconfig. Look for:
- IPv4 Address: your PC, for example
192.168.1.100. - Default Gateway: your router, for example
192.168.1.1.
2. Log in to your router
Type the Default Gateway address into your browser. The username and password are usually on a sticker on the router (often "admin").
3. Find the port forwarding page
| Router | Where to look |
|---|---|
| TP-Link | Advanced → NAT Forwarding → Virtual Servers |
| Netgear | Advanced → Advanced Setup → Port Forwarding / Port Triggering |
| ASUS | WAN → Virtual Server / Port Forwarding |
| Linksys | Security → Apps and Gaming → Single Port Forwarding |
| BT Smart Hub | Advanced Settings → Firewall → Port Forwarding |
| Virgin Media Hub | Advanced settings → Security → Port forwarding |
| Sky / Vodafone / others | Look for "Port Forwarding", "Virtual Server" or "NAT". Menus differ between models. |
4. Add the rule
| Setting | Value |
|---|---|
| Name | Minecraft |
| Protocol | TCP |
| External / internal port | 25565 (or the port you chose) |
| Internal IP / device | Your PC's IPv4 address from step 1 |
Using Geyser so Bedrock (phone/console) players can join? Add a second rule: UDP 19132.
5. Stop the address from changing
Routers can give your PC a new local address later, which silently breaks the rule. Look for DHCP reservation (or "Address reservation" / "Static lease") and reserve your PC's current address.
6. Allow it through Windows Firewall
The first time the server starts, Windows asks whether to allow Java. Tick Private networks and click Allow access. HostCraft can also add the rule for you from the Network tab.
7. Test it
Friends join using your public IP (search "what is my IP") followed by :25565. People on your own Wi-Fi must use your local address instead. Most routers can't loop back to their own public IP.
Can't port forward? (CGNAT)
Some internet providers, especially mobile and 4G/5G home broadband, share one public address between many homes ("CGNAT"). Port forwarding can't work then. Options: ask your provider for a public IPv4 address, use a tunnel like playit.gg, or use Tailscale or ZeroTier so friends join a private network with you.
My public IP keeps changing
Most home connections change their public IP now and then. A free dynamic DNS name like DuckDNS gives you an address such as myserver.duckdns.org that always points to your current IP.