Mar 02, 2026
Ignas R. & Paulius Z.
5min Read
Port forwarding a Minecraft server requires mapping your local machine’s IP address and the game’s port number within your router settings. This enables other players to connect to the locally hosted game server and play in multiplayer mode.
To successfully set up a multiplayer server, follow these five steps:
Finding your computer’s IP address and default gateway is the first step in forwarding your Minecraft port. This is because your router requires a precise destination to direct external game traffic to the machine where the Minecraft server is running.
An IP address, or specifically an IPv4 Address, is a unique numerical label assigned to your computer that enables other devices to identify it within the local network.
Without the IP address, the router cannot forward the traffic to the correct system because it can’t distinguish your Minecraft server from smartphones or laptops that are also connected to the local network.
Meanwhile, the default gateway is the IP address of your router, which serves as the access point into your local network. When a user connects to your Minecraft server, it uses this address to identify the router, which then forwards the request to the corresponding IP address within its local network.
Here is how to find the IP address and default gateway on Windows. After obtaining them, we’ll continue to set up a static IP address to ensure players can connect to your Minecraft server using the same address:
ipconfig



Meanwhile, the steps look like this on macOS:
netstat -nr | grep default
ipconfig getifaddr en0

If you use Linux, the procedure is as follows. Note that since we are using Ubuntu, the commands might differ slightly depending on your distro:
route -n | grep "^0.0.0.0" | cut -d ' ' -f 10
hostname -I

sudo nano /etc/netplan/01-netcfg.yaml
Configure the Minecraft server port to ensure it listens for incoming data on the correct channel. Depending on your Minecraft version, the port to use differs:
To do this, locate and edit your Minecraft server properties file by following these steps:

Technically, you can change the default Minecraft port to any number between 1 and 65535. However, it’s not recommended as it may conflict with another network service if you are unsure whether the port is free.
Moreover, using non-default ports requires every player to manually type the port number after the IP address to connect, which makes the process more complicated.
Allowing the Minecraft port through the firewall enables other players to connect to the game server running on your computer. This is crucial because your operating system’s security software is designed to automatically drop unsolicited incoming packets to prevent unauthorized access.
Here’s how to set up your Windows firewall to allow the Minecraft port:


In macOS, the process is more straightforward:

On Linux, configuring the system firewall to allow ports typically uses Uncomplicated Firewall (UFW). Here are the steps:
sudo apt install ufw
sudo ufw allow 25565/tcp
sudo ufw enable
If you want to learn more about this tool, check out our guide about how to configure the firewall on Ubuntu using UFW.
Port forwarding on the router bypasses the Network Address Translation (NAT) firewall, which hides internal devices’ actual addresses from the internet for security reasons. By creating a forwarding rule, you explicitly authorize the router to accept external requests on a specific port and funnel them directly to your server’s local IP address.
The steps to configure port forwarding depend on your router, but the general procedure remains the same. Here’s how to do it on a D-Link router:


While generally safe, opening ports to the internet creates a potential entry point for traffic. To minimize the risk, follow VPS security best practices, which apply to both a local and remote computer.
Restart your Minecraft server and connect to it to finalize the setup. Since the server typically reads configuration files and binds to ports during the startup sequence, rebooting ensures the changes are applied.

To do this, open your Minecraft server console and type /stop. Then, search what is my ip on Google to find your public IP address, which other players can then use to connect to your game server with this format:
185.185.185.185:25565
Change 185.185.185.185 with the actual IP address of your system and 25565 with your Minecraft server’s port number.
Never share your public IP on the internet, as this can expose your physical location and make you a potential target for numerous cyber attacks.
After forwarding your Minecraft server’s port, other players should be able to connect to your game server. This enables multiplayer on a self-managed server, where you have autonomy over game rules and performance, ensuring an enjoyable gaming experience.
To make multiplayer gameplay more fun, enhance the server by adding features such as land protection, an economy, or mini-games. The easiest way to do this is by installing a plugin, which you can obtain from a repository like Modrinth.
After downloading your desired extensions, check our guide on how to add plugins to your Minecraft server. Have fun!
