How To Port Forward A Minecraft Server On Linux, Windows, And MacOS


Ignas R.



Read in 5 minutes



How to Port Forward a Minecraft Server on Linux, Windows, and macOS



Creating your own Minecraft world on a local server can be exciting. It will only be visible to your friends, so playing alone can become tiring. Port forwarding makes it possible to make Minecraft servers visible for anyone to connect to and play.



This tutorial will demonstrate how to port forward a Windows, macOS or Linux server. It also discusses the configuration required.



What Is Port Forwarding? How to Port Forward Minecraft?Step 1. Step 2. Allow the Port on Minecraft Configuration Step 2.


Step 3. Forward the Port on the Router


Step 4. Step 4.




What is Port Forwarding?



If a user has a locally running game server and wants to play with friends, connecting via an inner IP address, such as 192.168.0.1 won't work because it's a local IP.



Port forwarding allows remote computers to connect your router and local network by using specific TCP and UDP ports. Usually, the port forwarding feature is available on most routers and can be accessed by logging in via the default router gateway.



How to Port Forward Minecraft?



You will need to discover the default server port, allow it through firewall, and tweak your router configuration in order to make a Minecraft server public.



Important! Important!



Step 1. Step 1.



1. Open the Minecraft server directory to locate the server.properties.


1. Right-click the file and open it with a text editor.


1. Find the server-port line


These are the default port numbers to use for Minecraft



Java Edition - 25565


19132-19133 – TCP and UDP ports to Bedrock.


You can change port settings by changing server-port value. We recommend using the default value.



Step 2. Allow the Port on Your Firewall



You must allow the Minecraft port number to your firewall to ensure that the server runs properly. This section will cover the process for three operating systems: Windows, macOS and Linux.



Firewall Management on Windows



1. Open Windows Defender Firewall for Advanced Security


1. Click on Inbound Rules, then select New Rule.


1. Choose Port and click Next.


1. Select TCP, then enter the Minecraft port numbers. In this instance, it's 25565. Once done, click Next.


1. Click the Next button until you reach the final step. Before clicking Finish, give your rule a name, like in this example:


1. After you have created the rule, make a new one with the same configuration, just for UDP.


Firewall Management on macOS



1. Go to System Preferences, and select Security & Privacy.


1. Choose Firewall and click on the Firewall Options button.


To unlock Firewall Options if the option is grayed-out, click on the lock icon in lower-left corner.



1. Click Add, locate the Java application and confirm your selection. Make sure the Allow incoming connection option is enabled.


Firewall Management on Linux



Unlike Windows or Mac, Linux comes with a more complex firewall. Paxton's blog We recommend checking out our tutorial on how to configure your Ubuntu firewall.



Step 3. Step 3.



With the firewall set up and incoming network requests allowed, proceed to create a port forward rule on your router. The steps are the same regardless of whether each router has a unique interface.



1. Find your default gateway IP address. It will be used to log in to the router.


2. Set up a static IP address.


3. Open the port forwarding options.


4. Specify which TCP/UDP port to forward.


Locating the Router Address and setting up a static IP on Windows



Press Windows + R and enter CMD to open the command prompt. Run the following command



The Default gateway will show the router's IP Address.



To create a static Internet Protocol address, press Windows+ R again and enter "ncpa.cpl". Right-click your network interface. Select Properties. Locate Internet Protocol Version 4 and select Properties.



Specify the preferred static address, subnet mask (255.255.255.0) and the router IP you acquired previously.



Once you're done, click OK and save your changes.



MacOS: Setting up a static IP and finding the Router Address



1. Navigate to System Preferences and click Network.


1. Find the network you're using and click Advanced.


1. Navigate the TCP/IP tab. The router's IP Address will be shown in the Router line.


Alternatively, open Terminal and use the following command to check the router IP address:



To create a static IP address, return to the TCP/IP Section, select Using DHCP With Manual Address, and then specify the IP address you wish to use. We recommend adding zero to the router IP.



To save your changes, click OK



Linux: Finding the Router Address and setting up a Static IP



Open Terminal and type the following command to check the router IP on Linux-based systems:



Edit the primary network configuration file to set up a static IP. For example, you can access Ubuntu 18.04 configuration information by entering this command in Terminal and pressing Enter.



Here's an example configuration in which gateway4 is your router IP, and addresses refers your preferred static IPv4 adress:



Once you have done this, save the 01-netcfg.yaml changes.



Logging in with the Router



Paste the router IP address into your browser's address bar and press Enter. You will see a login page.



It will ask for your username or password. If you are unsure where to find them, check the stickers on your router. You can also Google the model number and name of your router along with keywords such as default login credentials.



If your router is still using the factory default credentials, change them immediately as anyone could access your network.



Once logged in, look for options related to virtual server or port forwarding. We will be using a D-Link router in this tutorial. Its interface for port forwarding looks like this:



Make sure the Enabled option is checked, give the forwarding policy a name and specify the local static IP you have previously set, and then enter the Minecraft server port. In this instance, it's 25565.



Don't forget the configuration for both TCP & UDP ports.



Once you are done, save the changes.



If you are still uncertain about the port forwarding process for your router's model, you can search the device name and read the manual.



Step 4. Step 4.



You will need to restart Minecraft server in order for port forwarding changes apply. To do so, enter /stop on the server console and reinitialize the server.



Once the server is up and running, open Google and search "What's your IP?" This will display your public IP address. You will need this to share with the people who you are playing with.



Expert Tip



Never share your public IP on the internet as this can expose your physical location and make you a target of cyber attacks.



Egidijus Navardauskas



Cyber Security Head



Now players can connect to the server. Be aware that if the default port 25565 is changed, users will need the 185.185.185.185.185.port syntax to connect.



Alternativ, you can simply enter the IP address.



Port forwarding allows you and other players to play on a local Minecraft server, making your gaming experience more interesting and unique.



In this tutorial, we have covered the process of port forwarding a Minecraft server on Windows, macOS, and Linux systems. We've also shown how to allow an application through a firewall and navigate the router interface.



You can ask any questions in the comments section below.



How to Install Minecraft Mods Best Minecraft Mods



Ignas Rimkunas



Hostinger's technical content writer, Ignas. As a Customer Success Specialist, Ignas has helped people solve complex technical issues. His current goal is to write simple articles that make it easy for people to understand so that such issues don't happen. Ignas likes video games and fixing things around the house in his spare time.


Created: 09/08/2022 23:38:52
Page views: 32
CREATE NEW PAGE