Giovanni's Diary > Subjects > Programming > Notes >

Setting up a Minecraft server

In this page I want to quickly explain how to setup a minecraft server. You can follow this document regardless of your platform since you only need the java virtual machine to run the server.

Vanilla server

Setting up a vanilla server is very simple, just download the jar file from the Mojang website and move It on Its own directory (it will generate a bunch of garbage) and run it using the JVM:

java -Xmx1024M -Xms1024M -jar server.jar nogui 

You can set many flags to fine tune various aspects of the server such as how much resources does it use and multi threading. You can find some information here.

The first time you run the server, It will fail with error "Failed to load eula.txt". You are required to accept the eula agreement which you can find here. If you want to proceed, you should edit a file named "eula.txt" in the same directory as the .jar file and set the "eula" value to true.

eula=true

Then run the server again and you should see a message saying "Starting Minecraft server on *:25565" and the world being generated. Congratulations, you have your vanilla minecraft server. You can connect to the server via the IP of the machine in the network.

Note that if you have a firewall, you need to check that the port is accessible from other machines. If you need the server to be reachable from other networks, you need to configure port forwarding on your router or use a VPN.

PaperMC

PaperMC is a popular server that enables the use of plugins. The experience is very similar to the vanilla server but you also get to configure all the plugins.

You can download paper from the official website and run it with the JVM:

java -Xmx1024M -Xms1024M -jar paper-1.21.4-231.jar nogui

As always, you will need to edit the eula file that will be generated after the first run.

You can browse and download plugins in the Hangar website, then move them in the "plugin" directory in your server's directory.


Travel: Programming Notes, Index