Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

To let friends connect to a self-hosted Minecraft server over the internet, configure three things: the Minecraft server must listen on the intended port, the host computer’s firewall must allow it, and the router must forward that port to the computer’s private IP address.

For the default configurations, Java Edition normally uses TCP 25565. Bedrock Dedicated Server normally uses UDP 19132 for IPv4 and UDP 19133 for IPv6. Always check your server’s configuration instead of assuming the defaults.

First, identify your Minecraft edition

Server Default port Protocol
Java Edition dedicated server 25565 TCP
Bedrock Dedicated Server, IPv4 19132 UDP
Bedrock Dedicated Server, IPv6 19133 UDP

These defaults come from Mojang’s Java server documentation and Microsoft’s Bedrock Dedicated Server documentation. A customized server, proxy, modded setup, or hosting wrapper may use different ports.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This guide is for a dedicated server running on your own computer or network. A normal Bedrock world opened with Invite to Game is not automatically a Bedrock Dedicated Server, so forwarding port 19132 will not turn every Bedrock multiplayer session into a public server. Minecraft Realms also does not require router port forwarding because Mojang hosts the service. See Mojang’s multiplayer guidance for the distinction between LAN play, online servers, and Realms: Minecraft multiplayer guide.

#1 Best Overall
Minecraft | Java & Bedrock Deluxe Collection | Windows Digital Code
  • DELUXE COLLECTION — Includes the base game, three add-ons (Celebration Food, Rescue Dogs, and Plenty O’ Blocks), three exclusive Character Creator items, and 700 Minecoins.
  • CREATE — Build whatever you can imagine in your own infinite world that’s unique in every playthrough.
  • EXPLORE — Discover biomes, resources, and mobs, and craft your way through a world filled with surprises in the ultimate sandbox game.
  • SURVIVE — Experience unforgettable adventures as you face mysterious foes, traverse exciting landscapes, and travel to perilous dimensions.
  • PLAY TOGETHER — Have a blast with friends, whether you’re sitting on the same couch in split screen or miles apart in cross-platform play for console, mobile, and PC.

What opening a port actually does

When a friend connects, traffic follows this path:

Friend on the internet
        ↓
Your public IP and external port
        ↓
Home router port-forwarding rule
        ↓
Your computer’s private IP and internal port
        ↓
Operating-system firewall
        ↓
Minecraft server process

Your public or WAN IP identifies your internet connection. Your private or LAN IP identifies the server computer inside your home network, such as 192.168.1.25 or 10.0.0.25.

Port forwarding is a router rule that sends traffic arriving on a particular external port to a particular private IP and internal port. It is separate from a computer firewall rule. Opening the router port alone is not enough.

Before you begin

  • Install the correct dedicated server software and start it successfully.
  • Confirm that the client and server versions are compatible. Java client and server versions must match; Bedrock protocol compatibility can also change between releases. See the Mojang multiplayer guide and Microsoft Bedrock setup documentation.
  • Know the server computer’s private IPv4 address.
  • Have administrator access to the router and the computer.
  • Preferably connect the server computer by Ethernet.
  • Know whether your router receives a public IPv4 address rather than an address behind carrier-grade NAT.

1. Check the configured Minecraft port

Java Edition

Open the server folder’s server.properties file and find:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
server-port=25565

Forward the number shown there. If it has been changed, do not forward 25565 unless that is still the port the server uses.

For ordinary installations, leave server-ip blank. Entering the public IP there is usually incorrect and can prevent the server from binding properly. The official Java server software is available from Minecraft’s Java server download page.

Bedrock Dedicated Server

In the Bedrock server folder’s server.properties, check:

Rank #2
Minecraft | Java & Bedrock Ultimate Collection | Windows Digital Code
  • ULTIMATE COLLECTION — Includes the base game, five add-ons (Celebration Food, Rescue Dogs, Plenty O’ Blocks, Decocraft, and Weapons + Tools), five exclusive Character Creator items, and 1000 Minecoins.
  • CREATE — Build whatever you can imagine in your own infinite world that’s unique in every playthrough.
  • EXPLORE — Discover biomes, resources, and mobs, and craft your way through a world filled with surprises in the ultimate sandbox game.
  • SURVIVE — Experience unforgettable adventures as you face mysterious foes, traverse exciting landscapes, and travel to perilous dimensions.
  • PLAY TOGETHER — Have a blast with friends, whether you’re sitting on the same couch in split screen or miles apart in cross-platform play for console, mobile, and PC.
server-port=19132
server-portv6=19133

server-port is the IPv4 listening port and server-portv6 is the IPv6 listening port, as documented by Microsoft in its Bedrock server properties reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Most home-router setups need only an IPv4 rule for UDP 19132. Do not automatically create an IPv6 rule unless your router, ISP, firewall, server, and players are actually using IPv6. Bedrock Dedicated Server downloads and setup information are available from the official Bedrock server page.

2. Find the server computer’s private IP

On Windows, open Command Prompt and run:

ipconfig

Find the active network adapter’s IPv4 Address. On Linux, use:

ip addr
# or
hostname -I

On macOS, use:

ifconfig

Do not use 127.0.0.1 or localhost as the router destination; those refer only to the local computer. Do not use your public IP as the internal destination.

A private IP can change after a reboot or router lease renewal. Create a DHCP reservation for the server computer in the router’s LAN or DHCP settings. This is generally safer for beginners than manually assigning a static address because the router continues to provide the correct gateway and DNS settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Allow Minecraft through the computer firewall

Windows

When a server starts, Windows Defender Firewall may ask whether to allow it. Permit the server on the profile appropriate to your network, and avoid allowing more access than necessary.

Rank #3
Minecraft | Standard Edition | XBOX Digital
  • Create and shape an infinite world, explore varied biomes filled with creatures and surprises, and go on thrilling adventures to perilous places and face mysterious foes.
  • Play with friends across devices or in local multiplayer.
  • Connect with millions of players on community servers, or subscribe to Realms Plus to play with up to 10 friends on your own private server.
  • Get creator-made add-ons, thrilling worlds, and stylish cosmetics on Minecraft Marketplace; subscribe to Marketplace Pass (or Realms Plus) to access 150+ worlds, skin & textures packs, and more—refreshed monthly.

To create a rule manually:

  1. Open Windows Defender Firewall with Advanced Security.
  2. Select Inbound Rules.
  3. Choose New Rule.
  4. Select Port.
  5. Choose the correct protocol and configured port.
  6. Select Allow the connection.
  7. Limit the profiles where practical and give the rule a name such as Minecraft Java Server.

Use TCP for a normal Java server and UDP for a Bedrock Dedicated Server. Do not disable the entire Windows firewall as a shortcut.

Linux with UFW

Use the protocol and port required by your server. Examples include:

# Java example
sudo ufw allow 25565/tcp

# Bedrock IPv4 example
sudo ufw allow 19132/udp

sudo ufw reload

Microsoft’s Bedrock setup guide also shows rules for ports 19132 and 19133, but the exact rule should match your server, protocol, distribution, and firewall configuration. A container, wrapper, or custom server may require additional network configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Create the router port-forwarding rule

Router interfaces differ. Look for Port Forwarding, Port Mapping, NAT Forwarding, Virtual Server, or Gaming.

Field Java example Bedrock example
Name Minecraft Java Minecraft Bedrock
Protocol TCP UDP
External/start port 25565 19132
External/end port 25565 19132
Internal/start port 25565 19132
Internal/end port 25565 19132
Destination IP Server computer’s private IP Server computer’s private IP
Enabled Yes Yes

Use the actual port from server.properties. Keeping the external and internal port numbers the same is simplest. They can be different, but then players must enter the external port while the server continues listening on the internal one.

For example, a Java rule might be:

TCP 25565 on the internet → 192.168.1.25:25565

A Bedrock IPv4 rule might be:

UDP 19132 on the internet → 192.168.1.25:19132

5. Tell friends how to connect

Friends outside your home network need your public IP address, not the server computer’s private IP. They should connect using:

Rank #4
Minecraft
  • Skins! We have biome settlers, city folk, town folk, and more!
  • The Nether and all its inhabitants. Fight Ghasts and make friends with Pigmen
  • Cross platform play for up to five players between Pocket Edition and Windows 10
  • Revamped touch controls, controller support, and a controller mapping screen
  • Enhanced Weather effects! Accumulating snow and more
  • Java: PUBLIC_IP when using the default port, or PUBLIC_IP:PORT for a non-default external port.
  • Bedrock: Enter the public address and port in the Add Server screen.

Your public IP may change when the router or modem reconnects. Dynamic DNS can provide a hostname that updates when the public IP changes, but it does not fix CGNAT, a missing port-forwarding rule, or a stopped server. Never assume a home public IP is permanent.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

6. Test in the right order

  1. Start the Minecraft server and wait for startup to complete.
  2. Test on the server computer with localhost or 127.0.0.1.
  3. Test from another device on the same LAN using the server computer’s private IP.
  4. Test from a genuinely external network, such as a phone using cellular data or a friend’s home connection.
  5. Have the remote player connect using the public address and correct port.

A public-IP test from inside your own home can fail even when external access works. Some routers do not support NAT loopback, also called hairpin NAT. A successful LAN test plus a failed in-home public-IP test is not conclusive; test from outside the network.

Online port checkers are limited. Many test TCP only, making them unsuitable for confirming a UDP Bedrock port. The most useful test is a real connection attempt from an external network, while the server is running and listening.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting: works locally but not over the internet

Use this order:

Works on the same computer?

If not, fix the server installation, configuration, version, or local binding first. The router cannot forward traffic to a server that is not listening.

Works from another device on the LAN?

If not, check the private IP, operating-system firewall, configured port, protocol, and whether the server is bound only to localhost or another unavailable interface.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Works on the LAN but not externally?

  • Confirm the router rule points to the current private IP.
  • Confirm the server is running and uses the forwarded port.
  • Check TCP versus UDP.
  • Confirm the router rule is enabled and attached to the correct WAN connection.
  • Check whether the public IP changed.
  • Check for double NAT or CGNAT.
  • Confirm the remote player is using the correct edition and compatible version.

CGNAT and double NAT

Ordinary IPv4 port forwarding generally cannot work when your ISP places your connection behind carrier-grade NAT. Compare the WAN address shown in your router with the public address shown by a reputable external IP-information service. If they differ, or the router shows a private or shared address, another layer of NAT may be present.

Best Value
Minecraft - Bedrock Edition PS4
  • Play and share with friends on console, mobile and Windows 10
  • discover community creations in the new in-game store
  • access new mini games and game modes through servers

Also check for a network like:

Internet → ISP gateway → personal router → Minecraft computer

With double NAT, the upstream ISP gateway must forward the port to the second router, which then forwards it to the server computer. Alternatively, put the ISP gateway into bridge or modem mode where supported, allowing the personal router to receive the public address.

If the ISP uses CGNAT, possible solutions include requesting a public IPv4 address, using IPv6 when every participant supports it and the firewall is configured correctly, using a private overlay or tunnel, or choosing Realms or managed hosting.

Running multiple Minecraft servers

Each server needs a distinct listening port, a matching firewall rule, and a matching router rule. Java servers normally use different TCP ports. Bedrock servers need different configured UDP ports. Players must enter the external port assigned to the server they want.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Be careful with Bedrock’s LAN visibility setting: Microsoft notes that enabling LAN visibility can cause binding to default ports even when custom port values are configured. Check the Bedrock server properties documentation when using custom ports or multiple instances.

Security checklist

Port forwarding exposes the selected Minecraft service to the internet. Before inviting players:

  • Keep Minecraft server software and its Java or operating-system runtime updated.
  • Use an allowlist for a private friend group.
  • Keep online authentication enabled. Microsoft recommends this for internet-facing Bedrock servers.
  • Give operator privileges only to trusted users.
  • Back up the world before upgrades and major configuration changes.
  • Allow only the required port and protocol through the firewall.
  • Do not expose RCON, SSH, router administration, databases, or other management ports unnecessarily.
  • Do not share router credentials.
  • Review console logs for unexpected activity.

Changing 25565 or 19132 can avoid a collision with another local service and may reduce casual automated noise, but it is not a security control. A changed port still needs updates, authentication, backups, and careful permissions.

Alternatives to port forwarding

  • LAN play: Best when everyone is on the same local network; router forwarding is normally unnecessary.
  • Realms: A simple official option for small private groups without home-router administration. It is less suitable for heavily modded servers, extensive plugins, or full operating-system control. See the official Realms page.
  • Managed hosting: Better for users who need backups, higher uptime, larger communities, or mod and plugin support without maintaining home hardware. Compare recurring price, resources, backups, location, protection, cancellation terms, and edition support.
  • Private overlay or tunnel services: Tools such as Tailscale, ZeroTier, or playit.gg may help small groups when inbound IPv4 is blocked. Players may need an app or account, and relay latency or plan limits may apply.

Choose self-hosting when you have a reachable public address and want full control. Choose Realms or hosting when convenience, uptime, backups, or maintenance matter more. Choose a tunnel or overlay when CGNAT or router restrictions prevent conventional forwarding.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 3
Minecraft | Standard Edition | XBOX Digital
Minecraft | Standard Edition | XBOX Digital
Play with friends across devices or in local multiplayer.
$19.99
Bestseller No. 4
Minecraft
Minecraft
Skins! We have biome settlers, city folk, town folk, and more!; The Nether and all its inhabitants. Fight Ghasts and make friends with Pigmen
$6.99
Bestseller No. 5
Minecraft - Bedrock Edition PS4
Minecraft - Bedrock Edition PS4
Play and share with friends on console, mobile and Windows 10; discover community creations in the new in-game store
$42.49

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.