User:ExtremeHeat11/sandbox/Setting up a server/Windows instructions

From Minecraft Wiki
Jump to: navigation, search

Windows instructions[edit]

Verify that Java is installed[edit]

You must first verify that the Java runtime environment (JRE) is installed on your computer.

To do so, follow the following steps:

  1. Hold your Windows key, then press 'R'; and in the prompt, type "cmd" and press OK.
  2. In Command Prompt, execute the command: java -version
  3. If the first line that it returned did not say java version "???", then you do not have a valid install of Java on your system; and should install the appropriate version from here.

Start the Minecraft server[edit]

If you have not already done so, create a dedicated folder somewhere on your PC for which you will run the server in. You should not use generic places like the Desktop or your Downloads folder.

Move the server software that you downloaded over to the new folder that you made and run it by double clicking it. The first time you run the server it will close immediately after and generate a few files, one of which should be called "eula.txt".

You must open this file, and set the second line of the file which should read eula=false to eula=true. By doing so, you are in agreement to the Minecraft End User Licence Agreement.

You can then start the server again and it should continue starting the server as normal. If you are hosting the server locally on your PC, you may connect to the server directly by using localhost to connect in-game.

To allow other people to connect to your server, you must use a method such as #Port forwarding if you are using a router provided by either you or your Internet Service Provider.

Or if you are using a router and just want to let people on your local area network (LAN) connect, you can open a Command prompt by searching for it at Start and run the command ipconfig /all | find "IPv4". This will give you a list of local IPv4 addresses that others on your network can connect to.

When either port forwarding or letting people on your LAN connect, you must ensure that you do not have any firewalls, either Windows Firewall or any 3rd party software blocking the external connections.

Starting via command line[edit]

More advanced users can start the server command-line for more control over the server. This allows you to add JVM flags to the server that can help to increase the allocated memory that the server can use, for example.

It is worth noting that increasing the memory on your server will not directly increase your performance, rather it will simply add more capacity to the server for running tasks and storing information to memory.

To have your server automatically launch with specified command line arguments, open the folder which contains the server and ⇧ Shift + Right click to get an extended context menu and press "Open command window here".

Create a text file by using one of the following commands depending on if you are using the Java archive or executable.

.exe version: echo java -jar minecraft_server.1.14.2.exe > run.bat && echo pause >> run.bat

.jar version: echo java -jar minecraft_server.1.14.2.jar > run.bat && echo pause >> run.bat

A file named "run.bat" should be generated, which you can run to start the server. You should be able to right click the file and select "Edit" to add additional arguments when starting the server.

Adding more RAM[edit]

If you haven't read the above, please see it.

Right click "run.bat", and select Edit. Refer to the first line and before the -jar argument, prepend the -Xmx argument to allocate more RAM capacity to the server. Note that this argument will only be setting the maximum amount of memory that the JVM will be able to use. This means that when you start the server, Java will allocate more memory when the server needs it up until it hits the limit you set.

Here's a conversion table you can use for adding more RAM with the -Xmx argument; please keep in mind that if you are on a 32-bit OS or Java installation, you will be unable to allocate more than 1500MB RAM.

RAM JVM Argument
1 GB -Xmx1G
1.5 GB (1500MB) -Xmx1500M
2 GB -Xmx2G
2.5 GB (2500MB) -Xmx1500M
3 GB (2500MB) -Xmx2G
3.5 GB (2500MB) -Xmx3500M

Once you have the JVM Argument, add it to the line as explained, so replace java -jar with java [JVM Argument] -jar.

For example, you could use java -XMX3G minecraft_server.(exe|jar) to launch the server with 3 Gigabytes of RAM.