Skip to main contentdfsdf

Home/ knightpastry6's Library/ Notes/ How To Port Forward A Minecraft Server On Linux, Windows, And MacOS

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

from web site

Rokan themes my world life


Ignas R.



5min Read



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



It can be very exciting to create your Minecraft world from scratch on a local server. However, you will only see it, and it can get tedious to play alone. 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? Step 1. Step 2. Allow the Port to Your Firewall


Step 3. Step 3.


Step 4. Step 4.




What is Port Forwarding?



If a user has a game server running locally on their machine and wants to play together with friends, connecting via an internal IP address, like 192.168.0.1, won't work as it is a local IP address.



Port forwarding allows remote computers that are not connected to your router to connect to your local network. It uses specific TCP/UDP ports. Usually, port forwarding can be accessed via default router gateway.



How do you 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! Before using the port forward feature, you should set up a Minecraft server.



Step 1. Step 1.



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


1. Right-click on the file to open it in a text editor.


1. Find the server port line:


Here are the default port numbers of Minecraft:



Java Edition - 25565


19132-19133: TCP and UDP ports available for Bedrock.


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



Step 2. Step 2.



To ensure that the server works correctly, you will need to allow the Minecraft port number via your firewall. This section will cover the process for three operating systems: Windows, macOS and Linux.



Firewall Management on Windows



1. Open Windows Defender Firewall Advanced Security.


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


1. Choose Port and click Next.


1. Select TCP, and enter the Minecraft port number. It's 25565 in this example. Once done, click Next.


1. Click Next to continue. Before clicking Finish, give your rule a name, like in this example:


1. After you have created the rules, create a new one using the same configuration as the original, but for UDP.


Firewall Management in macOS



1. Select Security & Privacy from System Preferences.


1. Click on Firewall Options to choose the Firewall option.


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



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


Firewall Management on Linux



Linux comes with a much more complex firewall than Windows, Mac, or both. We recommend checking out our tutorial on how to configure your Ubuntu firewall.



Step 3. Step 3.



Once you have the firewall setup and all incoming network requests permitted, you can create a port forwarding rule on your router. Each router will have a different interface but the steps will be identical.



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


2. Establish a static IP address.


3. Open the port forwarding options.


4. Specify which TCP/UDP ports to forward.


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



To open the command window, press Windows + R. Enter CMD. The following command should be executed:



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



To set up a static IP address, press Windows + R again and enter ncpa.cpl. Right-click the network interface and select Properties. Next, locate Internet Protocol Version 4 ("TCP/IP"), and click Properties again.



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



Once you're done click OK to save your changes.



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



1. Go to System Preferences and select Network.


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


1. Navigate to the TCP/IP tab. The router's IP address will be displayed on the Router line.


Alternativly, you can open Terminal and run the following command:



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 a 0 to the router IP.



To save the changes, click OK



Finding the Router Address and Setting up a Static IP on Linux



To check the router IP on Linux based systems, open Terminal and enter the following command:



You will need to edit your primary network configuration file in order to set up a static Internet Protocol. You can access the Ubuntu 18.04 configuration by copying this command into Terminal, and then pressing Enter.



Here's an example configuration where gateway4 is your router IP and addresses refers to your preferred static IPv4 address:



Once you are done, save the changes to the 01_netcfg.yaml folder.



Logging in the Router



Enter the router IP address in the address bar of your browser and press Enter. You will see a login page.



It will ask you for your username and password. If you are unsure where to find them, check the stickers on your router. Another option is to Google the router's name and model number along with keywords like default login credentials.



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



Once you have logged in, you can look for options regarding virtual server or port forwarding. This tutorial will use a D-Link router. The interface for port forwarding looks something like this:



Click the Enabled button, give the forwarding rules a name, specify your local static IP address, and enter the Minecraft server Port. It's 25565 in this example.



Don't forget to apply the configuration for both TCP and UDP ports.



Once done, save the changes.



If you are still not sure about the port forwarding procedure for your router, you can Google the device name to find the manual.



Step 4. Step 4.



For the port forwarding changes to apply, you will need to restart your Minecraft server. To do so, enter /stop on the server console and reinitialize the server.



After the server has been restarted, open Google by entering "What's My IP" This will display your public IP address. You will need this to share with the people who you are playing with.



Expert Tip



Don't share your public IP via the internet. This could expose your physical location and make it a target for cyber attackers.



Egidijus Navardauskas



Cyber Security Head



Now players will be able to join the server. Keep in mind that if the default server port 25565 was changed, users would need to connect using the 185.185.185.185:port syntax.



Alternativ, you can simply enter the IP address.



Having a local Minecraft server with port forwarding allows you to play with other people, making your gameplay experience more exciting 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 you can allow an application to pass through firewalls and navigate the router interface.



If you have any further questions, please let us know in the comments below.



How to Install Minecraft Mods Best Minecraft Mods



Ignas Rimkunas



Hostinger's technical content writer, Ignas. After working as a Customer Success Specialist and helping others with complex technical issues, his current goal was to create easy-to-follow articles that will make these issues disappear. Ignas loves to play video games, and fix things around his home.
rokanthemes.com

knightpastry6

Saved by knightpastry6

on Aug 27, 22