How to set up a Minecraft Server

A guide by Kyle Phillips

Getting Started#

Prerequisites

The Minecraft Server executable requires the Java Runtime Environment to be installed on your computer. If you do not have Java installed, or think you may have an outdated version, you can download the latest version here.

Setting up the server files

Firstly, you will need the server files.

  1. Go to the Minecraft Server Download page and download the minecraft_server.<version>.jar file

  2. Create a new folder with a memorable name (e.g. Minecraft Server 1.17) and move the minecraft_server.<version>.jar file into your new folder.

  3. Open the minecraft_server.<version>.jar file with Java by double clicking on it.

You should now see some new files appear in your server directory.

In the server directory there is a subdirectory titled "logs", and "eula.txt", "server.jar", and "server.properties" files

Server Configuration#

To host a Minecraft Server, you must agree to the End User License Agreement (EULA)

  1. Inside of your server directory, you should be able to see a eula.txt file. Double click on this file to open it.

  2. Read the contents of the file. Most Importantly, read the Minecraft EULA.

  3. Only if you agree to the EULA, change eula=false to eula=true.

    (If you don’t want to agree to the EULA, stop here and check out Minetest instead!)

  4. Save and close the eula.txt file.

Gathering Device Information#

You’re going to need to gather a series of unique details about your device and network configuration. The following steps will guide you through the process of finding the IPv4 address and MAC Address of your Server Computer, and the Default Gateway address of your router. Be sure to write these addresses down, as you will need each one for various stages of the configuration process.

Finding the local IPv4 Address of the Server Computer

Each device in your home network has it’s own local IP (Internet Protocol) address. IP addresses are used to make sure that every network transmission is sent towards its intended device. We’re going to need to find the IP address of the device that is hosting the Minecraft server in order to configure our home network so that this device is set up to send and recieve the Minecraft server transmissions.

Windows Instructions

  1. Open the command prompt by holding down the Windows key and press R to bring up the Run dialogue
  2. Type cmd into the Run dialogue and hit Enter
  3. In the command prompt, type in ipconfig and hit Enter
  4. In the console you should be able to see an overview of the Windows IP Configuration. Look for the line starting with IPv4 Address to find your IPv4 address. Make sure to make a note of this, because you will need to know this later.

macOS Instructions

  1. Open up the Terminal application from the Launchpad on macOS, or a terminal emulator which you prefer.
  2. In your terminal, type in ipconfig getifaddr en0 and hit Enter
  3. Your device’s IP address should be printed in the output. Make sure to make a note of this, because you will need to know this later.

Finding the Physical (MAC) Address of the Server Computer

Each device has it’s own Media Access Control (MAC) address that operates as a unique device identifier in a network. You will need to know your device’s MAC Address (aka. Physical Address) to set a Static DHCP Lease, which will be explained in a later part of this guide.

Windows Instructions

  1. Open the command prompt by holding down the Windows key and press R to bring up the Run dialogue
  2. Type cmd into the Run dialogue and hit Enter
  3. In the command prompt, type in ipconfig and hit Enter
  4. In the console you should be able to see an overview of the Windows IP Configuration. Look for the line starting with Physical Address to find your MAC address. Make sure to make a note of this, because you will need to know this later.

macOS Instructions

  1. Open up the Terminal application from the Launchpad on macOS, or a terminal emulator which you prefer.
  2. In your terminal, type in networksetup -listallhardwareports and hit Enter
  3. If you are connected via Wi-Fi:
    • You will find the MAC Address below the line which says Hardware Port: Wi-Fi
    • Find the address printed after the Ethernet Address: text. This is your device’s MAC Address. Make sure to make a note of this, because you will need to know this later.
    If you are connected via Ethernet
    1. You will find the MAC Address below the line which says Hardware Port: Ethernet
    2. Find the address printed after the Ethernet Address: text. This is your device’s MAC Address. Make sure to make a note of this, because you will need to know this later.

Finding the Default Gateway address

You’re going to need to know the address of your router on your your local network. This address is most commonly referred to as the Default Gateway address. You will need to use this address later to connect to your router’s management interface, which will be explained in the upcoming steps.

Windows Instructions

  1. Open the command prompt by holding down the Windows key and press R to bring up the Run dialogue
  2. Type cmd into the Run dialogue and hit Enter
  3. In the command prompt, type in ipconfig and hit Enter
  4. In the console you should be able to see an overview of the Windows IP Configuration. Look for the line starting with Default Gateway to find your Default Gateway address. Make sure to make a note of this, because you will need this for the following steps.

macOS Instructions

  1. Open up the Terminal application from the Launchpad on macOS, or a terminal emulator which you prefer.
  2. In your terminal, type in netstat -nr | grep default and hit Enter
  3. You should be able to see your default gateway address at the top of the output. Make sure to make a note of this, because you will need this for the following steps

Router Configuration#

Please note that the following information is presented as a general guide, as these following steps can vary a lot depending on which router you are using. If you have any trouble at any point following along with any of the router configurations, please make sure that you know the brand and model of your router so that you can easily search for more information online if you need.

Most household routers will have a web interface that allows you to manage and configure services that you can connect to via the router’s Default Gateway Address. To configure a port forwarding rule, first we need to log in to the router web interface.

Accessing the Router Administration panel

With the Default Gateway address that you found earlier, we can use a web browser to navigate to the web interface that is used to configure your router.

  1. Open up a web browser, and in the navigation bar, enter the Default Gateway address.
  2. If the page requests for a login, the default username and password can be found in it’s manual, or online. You could also try using the username admin with the password being either password or admin, as these are usually the default login credentials on most household routers.

Setting a Static DHCP lease for the Server Computer

DHCP (Dynamic Host Configuration Protocol) is a very commonly used routing service that automatically provides each device on a network with their own IP address. If your router uses DHCP (Which it most likely does), you’re going to want to set a static DHCP lease to make sure that the Server Computer’s IP address doesn’t change, or else you will have to reconfigure your Router and Minecraft Server with a new address each time it changes.

  1. In the router configuration panel, you will need to find the DHCP menu. If you can’t find it, you might be able to find it under Advanced Mode, or under a Services or Routing category. If you still can’t find it, try searching online for static DHCP lease configuration guides for your specific router model.
  2. Under the list of Static Leases, Add a Static Lease for your Server Computer with the following settings:

Port Forwarding

In order to allow people from outside your local network to connect to your Minecraft Server, you will need to configure a port forwarding rule in your router’s administration dashboard.

In the following steps, we will be configuring a Port Forwarding rule which will allow people from outside your private local-area network to connect to a specific service on your computer (in this case, a Minecraft server) over the internet, without exposing the rest of your private network to the outside world.

  1. In the router configuration panel, you will need to find the Port Forwarding menu. If you can’t find it, you might be able to find it under Advanced Mode, a Games and Services category, or under Firewall settings. If you still can’t find it, try searching online for port forwarding guides for your specific router model.
  2. Once you have found the Port Forwarding options, You’re going to need to create a new Port Forwarding rule with the following settings:
    • Set the configuration name to Minecraft
    • Set the WAN and LAN port to 25565
    • Make sure the protocol is set to both UDP and TCP
    • Set the destination IP address to the IPv4 address of the Server Computer which you found earlier.

Remember to save the changes that you have made to your router before you proceed.

Configuring the Server Properties#

In this step, we will be configuring the rest of the server files so that the Minecraft server can be fully operational. For this, you will need to return to the server computer that you downloaded the Minecraft server files onto. Please make sure that you can access the server directory that you made earlier in the Getting Started section before you proceed.

In the server directory, you should be able to see a file called server.properties. Open this file with a text editor (e.g. You can use Notepad on Windows or TextEdit on macOS, or vim) and edit it to suit your needs.

To find out more information about the server.properties file, please refer to the Minecraft Wiki Page.

Launching the Server#

Now that we have configured the server, we can now start it and begin to play on a new world.

There are two recommended ways to start the server. The first and easiest method is to execute the server.jar file by:

  1. Right clicking on the server.jar file
  2. Select Open With…
  3. Open the server.jar file with the Java Runtime Environment

This will launch the server, and in most cases, this should be all you need. However, if you have a more powerful server computer and you would like more people to be able to play on your world at a time, you may wish to allocate more RAM to the server. In order to do that, you will need to create a startup script to run your server through a terminal.

Launching the server with a script

In the following steps, we will be specifying an amount of RAM for the Minecraft server, and we will launch the server using a script.

Windows Instructions

  1. Right click in your server folder and create a new text document.
  2. In the view panel of the file explorer, make sure that Show File Extensions is ticked
  3. Rename the New Text Document.txt to server.bat
  4. Right click on the server.bat file, and select Edit
  5. In the notepad window, enter the following lines: @echo off java -Xms2G -Xmx4G -jar server.jar nogui PAUSE
  6. Change the lines to suit your needs as follows:
    • The -Xms option is the amount of RAM that the server will start with. I recommend 2 GB for an unmodified (vanilla) server.
    • The -Xmx option is the maximum amount of RAM that the server can use. I recommend 4 GB for an unmodified (vanilla) server.
    • Change the server.jar so that it matches the full name of the minecraft_server.<version>.jar file in your server directory.
    • If you wish to use the original GUI to monitor your server, remove the nogui argument. Note that if you choose to remove this option, there will be both a terminal window and a graphical server interface running concurrently, and closing either of them will stop the server.
    • The PAUSE command is to prevent the terminal window from closing immediately after the server process has stopped, either manually or as the result of a server crash. It will wait for you to press a key before the terminal closes. If you do not think you need this, you may remove that line, however I recommend that you keep it there, as it can be very useful to read over the lines that followed up to a crash if one were to occur.
  7. Save the server.bat file, and double click on it to run the minecraft server.