How to Port Forward a Minecraft Server (2026 Step-by-Step Guide)

If you run a Minecraft server at home and want friends outside your network to connect, you need to port forward. This guide covers the exact steps for any router.
What Is Port Forwarding?
Your router blocks incoming connections by default. Port forwarding tells the router to allow traffic on a specific port (25565 for Minecraft) and route it to your server computer.
Without port forwarding, only people on your local network (same WiFi) can connect.
Before You Start
-
Check your IP type. Some ISPs use CGNAT (Carrier-Grade NAT), which means you share a public IP with other customers. Port forwarding does not work with CGNAT. Call your ISP and ask for a public IP, or use a tunneling service like Playit.gg.
-
Set a static local IP for your server computer. If your local IP changes, the port forward rule breaks.
-
Know your router login. Usually at
192.168.1.1or192.168.0.1in your browser. Default credentials are often on a sticker on the router.
Step-by-Step: Port Forwarding
Step 1: Find Your Local IP
Open Command Prompt (Windows) or Terminal (Mac/Linux):
ipconfig (Windows)
ifconfig (Mac/Linux)
Look for "IPv4 Address" — it looks like 192.168.1.100.
Step 2: Set a Static IP
Go to your computer's network settings. Set the IPv4 address manually to the IP you found. Set the subnet mask to 255.255.255.0 and the gateway to your router's IP (usually 192.168.1.1).
Step 3: Log Into Your Router
Open a browser and go to your router's IP (e.g., 192.168.1.1). Log in with admin credentials.
Step 4: Find Port Forwarding Settings
Every router interface is different. Look for:
- Port Forwarding
- NAT / Virtual Servers
- Applications / Gaming
- Advanced Settings > Port Forwarding
Step 5: Create a Port Forward Rule
- Service Name: Minecraft (or any label)
- Protocol: TCP (Java) or TCP+UDP (Bedrock)
- External Port: 25565
- Internal Port: 25565
- Internal IP: Your server computer's static IP (e.g., 192.168.1.100)
- Enable: Yes
Save the rule.
Step 6: Allow Through Firewall
On Windows, open Windows Defender Firewall:
- Click "Advanced Settings"
- Inbound Rules > New Rule
- Port > TCP > 25565 > Allow > Name it "Minecraft"
On Linux:
sudo ufw allow 25565/tcp
Step 7: Find Your Public IP
Go to whatismyip.com. This is the IP you share with friends. They connect to your.public.ip:25565 in Minecraft.
Testing Your Port Forward
Use a port checker tool like canyouseeme.org. Enter port 25565. If it says "Success," your port forward is working.
Make sure your Minecraft server is running when you test. The port only appears open when the server is actively listening.
Common Issues
Port still shows as closed:
- Double-check the internal IP matches your server computer
- Make sure the Minecraft server is running
- Check your firewall rules
- Some routers need a reboot after adding rules
Friends cannot connect:
- Share your public IP, not your local IP (192.168.x.x is local only)
- Make sure they include the port if it is not 25565
- Your ISP might use CGNAT — call and ask
IP changes every day:
- Use a Dynamic DNS service (No-IP, DuckDNS) to get a hostname that updates automatically
Double NAT:
- If your ISP modem connects to your own router, you have double NAT. You need to port forward on both devices, or put the ISP modem in bridge mode.
Security Considerations
Port forwarding exposes your home IP to the internet. Take precautions:
- Keep your Minecraft server software updated
- Use a whitelist if your server is private
- Consider a firewall rule to rate-limit connections
- Do not share your public IP publicly (use a domain name instead)
- DDoS attacks can target your home connection
When to Skip Port Forwarding
If any of these apply, use a hosting provider instead:
- Your ISP uses CGNAT and will not give you a public IP
- You want DDoS protection
- You do not want your home IP exposed
- You need 24/7 uptime
- You have more than 10 players
Space-Node handles all of this for you. Dedicated hardware, DDoS protection, and no port forwarding needed.
Skip the port forwarding headache. View Minecraft Hosting Plans
