So you built a Minecraft server on your own computer and your friends can't connect. The missing piece is almost always port forwarding — telling your router to send incoming traffic on a specific port to your PC.
This guide walks through the whole process step by step. It works for Java Edition (port 25565) and Bedrock Edition (port 19132).
Fair warning: this involves logging into your router, and every router is different. It is not hard, but it is annoying. If you just want to play with friends without any of this, hosted Minecraft servers skip the entire process — your server gets a public IP automatically and you are playing in minutes.
But if you want to do it yourself, here is how.

What Is Port Forwarding?
Your home network sits behind a router. The router has one public IP address that the outside world sees, and your devices (PC, phone, console) each have a private IP address behind it.
When your friend types your IP into Minecraft, the connection hits your router. But the router does not know which device is running the Minecraft server — so it drops the connection.
Port forwarding creates a rule: "any traffic on port 25565 → send it to my PC." That is it. Once the rule exists, your friends can connect.
Step 1: Find Your PC's Local IP
You need to know your computer's private IP address on your home network. This is usually something like 192.168.1.x or 10.0.0.x.
Windows
Open Command Prompt and run:
ipconfig
Look for IPv4 Address under your active network adapter (usually "Ethernet adapter" or "Wi-Fi adapter"). It will be something like 192.168.1.105.
macOS
Open Terminal and run:
ipconfig getifaddr en0
If you are on Wi-Fi, use en0. For Ethernet, try en1.
Linux
Open Terminal and run:
hostname -I
The first address listed is usually your local IP.
Write this IP down. You will need it for the port forwarding rule.
Step 2: Log Into Your Router
Open a web browser and type your router's IP address. Common ones:
| Brand | Default Router IP |
|---|---|
| Most routers | 192.168.1.1 |
| Some Netgear/TP-Link | 192.168.0.1 |
| Some Linksys | 192.168.1.1 |
| Xfinity | 10.0.0.1 |
| Fritz!Box | 192.168.178.1 |
If none of those work, your router IP is the "Default Gateway" from the ipconfig / ip route command you ran earlier.
Log in with your router's admin credentials. If you have never changed them, check the sticker on the bottom of your router — the default username and password are usually printed there.
Can't find your password? Try
admin/adminoradmin/password. If those do not work, you may need to factory reset the router (last resort) or check your ISP's documentation.
Step 3: Find the Port Forwarding Section
Every router's interface is different, which is the most frustrating part. Look for any of these menu names:
- Port Forwarding
- Virtual Servers
- NAT / Gaming
- Firewall → Port Forwarding
- Advanced → Port Forwarding
- Network → NAT
Some routers bury it three menus deep. If you cannot find it, search "[your router model] port forwarding" — there are guides for almost every model out there.
Step 4: Create the Port Forwarding Rule
Create a new rule with these settings:
| Field | Java Edition | Bedrock Edition |
|---|---|---|
| Name / Description | Minecraft | Minecraft Bedrock |
| Internal IP | Your PC's local IP (e.g. 192.168.1.105) | Same |
| Internal Port | 25565 | 19132 |
| External Port | 25565 | 19132 |
| Protocol | TCP | UDP |
A few important details:
- Java Edition uses TCP. Some guides say TCP+UDP, but Minecraft Java only needs TCP.
- Bedrock Edition uses UDP. This includes mobile and console players.
- If you changed the port in your
server.propertiesfile, use that port instead of the default.
Save the rule and apply changes. Some routers require a reboot — if yours does, go ahead and restart it.
Step 5: Allow Minecraft Through Your Firewall
Your OS firewall might block incoming connections even after port forwarding is set up.
Windows Firewall
- Open Windows Defender Firewall (search for it in Start)
- Click Advanced Settings on the left
- Click Inbound Rules → New Rule
- Select Port → TCP → Specific local ports:
25565 - Allow the connection → apply to all profiles
- Name it "Minecraft Server"
Or just search for "Allow an app through firewall" and make sure javaw.exe (or your server JAR) is allowed on Private and Public networks.
macOS
macOS usually prompts you to allow incoming connections when you first start the server. Click Allow. If you missed it, go to System Settings → Network → Firewall → Options, and add your Java runtime.
Linux
sudo ufw allow 25565/tcp
Step 6: Find Your Public IP
Your friends need your public IP address to connect — not the 192.168.x.x one.
Go to whatismyip.com and copy the IPv4 address shown.
Give this IP to your friends. They type it into the Minecraft multiplayer server address field and connect.
If you are using a non-default port, they need to add it: 123.45.67.89:25566
Step 7: Test It
Before telling your friends, test it yourself:
- Make sure your Minecraft server is running
- Ask a friend on a different network (not your home Wi-Fi) to connect using your public IP
- Or use an online port checker like canyouseeme.org — enter port
25565and it will tell you if it is open
If the port shows as closed, double-check:
- The port forwarding rule is saved and active
- The internal IP matches your actual PC IP
- The protocol is correct (TCP for Java, UDP for Bedrock)
- Your firewall is not blocking the port
- Your Minecraft server is actually running
Common Problems
"My IP keeps changing"
Most home internet connections have a dynamic IP — your ISP changes it periodically. When it changes, your friends can no longer connect using the old IP.
Options:
- Check your IP regularly and update your friends (annoying)
- Set up Dynamic DNS (DDNS) — services like No-IP or DuckDNS give you a hostname (like
myserver.ddns.net) that automatically updates when your IP changes - Ask your ISP for a static IP — some ISPs offer this for free, others charge
"My ISP uses CGNAT"
Some ISPs (especially mobile/cellular and newer fiber providers) put you behind Carrier-Grade NAT (CGNAT). This means you share a public IP with other customers, and port forwarding simply will not work.
Signs you are behind CGNAT:
- Your router's WAN IP starts with
100.64.x.xor does not match whatismyip.com - Port forwarding is set up correctly but the port still shows as closed
If this is your situation, your options are limited:
- Ask your ISP to disable CGNAT or give you a public IP (some will, some will not)
- Use a VPN tunnel like Playit.gg or ngrok as a workaround
- Use a hosted server instead (no port forwarding needed at all)
"My friends can connect but it is laggy"
Your home upload speed matters. Minecraft needs about 3-5 Mbps upload for a smooth experience with a few players. Check your upload speed at speedtest.net.
Other common causes:
- Your PC is underpowered for the player count
- You are running the server and playing on the same machine
- Players are far away geographically (no way around physics)
"It works on my network but not from outside"
You might be testing from the same network. Many routers do not support NAT loopback (also called NAT hairpin), meaning you cannot connect to your own public IP from inside your network.
Always test from a different network — ask a friend to try, or use mobile data on your phone.
Security Considerations
Opening a port on your home network exposes your public IP address to anyone who connects. A few things to keep in mind:
- Only forward the ports you need — do not forward ranges or use DMZ mode
- Keep your server software updated — outdated Minecraft servers can have vulnerabilities
- Use a whitelist if you only want specific players to join
- Consider a firewall plugin like GriefPrevention to limit damage from bad actors
- Never share your public IP publicly (on social media, Discord servers with strangers, etc.) unless you are prepared for random traffic
Or Skip All of This
Port forwarding works, but it comes with headaches:
- Your IP changes and friends can't connect
- Your ISP blocks it with CGNAT
- Your upload speed bottlenecks everyone's experience
- Your PC has to stay on 24/7 for the server to be available
- You are exposing your home IP to the internet
Hosted Minecraft servers skip every single one of these problems. You get a dedicated IP, DDoS protection, NVMe storage, and your server runs 24/7 on hardware designed for it — no router configuration, no firewall rules, no ISP limitations.
On Swelis Hosting, you can have a server running in under a minute. Pick a plan, choose your server type, and share the IP with your friends. That is the entire setup.
Plans start at a few dollars a month, which is arguably less than the cost of the electricity to run your PC as a server 24/7.
Quick Reference
| Task | Details |
|---|---|
| Default Java port | 25565 (TCP) |
| Default Bedrock port | 19132 (UDP) |
| Find local IP | ipconfig (Windows) / hostname -I (Linux) |
| Find public IP | whatismyip.com |
| Router login | Usually 192.168.1.1 or 192.168.0.1 |
| Test port | canyouseeme.org |
| CGNAT check | Compare router WAN IP to whatismyip.com |
If port forwarding is giving you trouble and you just want to play, give hosted a try. Your friends will thank you.
Related Guides
- How to Set Up Your First Minecraft Server in Under 2 Minutes — the full setup walkthrough
- How to Make a Minecraft SMP Server in 2026 — plugins, permissions, and community setup
- How to Fix Minecraft Server Lag — optimize your server performance
