
Minecraft Server Ports and Port Forwarding Explained
Ports trip up a lot of people setting up their first server. This guide covers which ports Minecraft actually uses, how to forward them on your router, and why forwarding just won't work for some connections no matter what you try.
Java servers use port 25565 TCP, Bedrock uses 19132 UDP. Forward the right one on your router to your PC's local IP, then share your public IP or hostname with friends. If it won't work at all, you're probably behind CGNAT, and a hosted server sidesteps the whole issue.
Default Ports: 25565 TCP Java, 19132 UDP Bedrock
Minecraft Java Edition runs on port 25565 by default, and it uses TCP. Bedrock Edition is different, it uses port 19132, and it runs over UDP instead. Mixing these up is probably the most common mistake people make, so keep in mind which version you're running before you touch your router settings.
Changing the Port in server.properties
Don't want to use the default port? You can change it. Open up server.properties and look for the server-port line, then just type in whatever port number you want to use instead. Save the file and restart the server for it to take effect. Just remember, if you change it here, you'll also need to forward that new port on your router, not 25565. Our server.properties guide covers the rest of the settings in that file too.

Forwarding on a Home Router, Step by Step
Every router looks a little different, but the process is mostly the same everywhere. Log into your router's admin page, usually by typing something like 192.168.1.1 into your browser. Find the section called port forwarding, sometimes it's under NAT or virtual server instead. Add a new rule pointing your Minecraft port, 25565 for Java or 19132 for Bedrock, to your computer's local IP address. Save it, and you're basically done. It sometimes takes a restart of the router for the rule to actually kick in.
Local IP vs Public IP vs Hostname
These three get mixed up a lot, so here's the quick version. Your local IP is the address your computer has inside your home network, usually starts with 192.168. Your public IP is the address your whole house shows to the internet, and that's what friends outside your home actually need to connect. A hostname is just a friendlier name that points to your public IP, so you don't have to remember a string of numbers, and it can update automatically if your IP changes.
CGNAT: Why Forwarding Fails for Some Connections Entirely
Sometimes port forwarding just won't work, no matter how carefully you follow the steps. That's usually CGNAT, short for carrier grade NAT. Basically, your ISP is sharing one public IP across a bunch of different homes, so you don't actually have your own public IP to forward a port to in the first place. Call your ISP and ask if you're behind CGNAT, some will give you a real public IP if you ask, others won't budge at all.
Dynamic IP and Why the Address Stops Working
Most home internet connections don't have a fixed public IP. It changes now and then, sometimes when your router restarts, sometimes just randomly from your ISP's side. That's annoying because it means the IP address you gave your friends can just stop working out of nowhere. A dynamic DNS service can fix this, it gives you a hostname that keeps pointing to your current IP even after it changes.
Security Considerations When Opening a Home Port
Opening a port on your router does expose your computer a bit more to the outside internet, so it's worth taking a few basic precautions. Keep your server software updated, use a whitelist so random strangers can't just wander in, and don't forward any other ports you don't actually need open. It's not something to stress over too much, just don't leave things wide open longer than necessary.
When a Hosted Server Removes the Problem
If all this port forwarding stuff sounds like a hassle, or you're stuck behind CGNAT with no way around it, a hosted server just skips the problem entirely. No router settings, no dynamic IP worries, players connect straight to an address that always works. Check out our hosting plans and pricing if running your own hardware isn't worth the headache. And once your server's up, our guide on joining a Minecraft server walks friends through the rest.





