Minecraft Java Edition – Setting Up a MC Server on Ubuntu Server 19.04

minecraft-java-editionminecraft-java-edition-server

I'm trying to setup a Minecraft server of my own. I've successfully done so before on Windows, but since the new server will be always on and headless (remote access only, no screen or other peripherals attatched), I decided to use Ubuntu instead. Figured it couldn't be too different, but I was wrong.

Google isn't much of a help: every tutorial starts with a list of dependencies to install, and every tutorial has a different list.

On Windows, it was as simple as installing a JRE and downloading and running the server.jar. I don't see why I need a JDK, and why I specifically need a headless JDK. I also don't understand why I would need the Screen package on a displayless server.

Of course, none of the tutorials actually explain WHY I need those dependencies, or what they do. I'm no security expert, but I refuse to install a random list of programs just because a site tells me it will work. Therefore, I'd like to ask what dependencies I NEED to install, and why?

Any other help or tips are also appreciated.

Thanks in advance.

Best Answer

Therefore, I'd like to ask what dependencies I NEED to install, and why?

You only need the JRE (preferably Java 8). This is the openjdk-8-jre-headless package on Ubuntu. You can download the server file on minecraft.net.

Then you run it like this:

$ java -Xmx1024M -Xms1024M -jar server.jar nogui

Where

  • -Xmx1024M says that the server can use no more than 1024MB.
  • -Xms1024M says that the server initially starts with 1024MB.
  • server.jar is your Minecraft Server jar that you dowloaded
  • nogui specifies that the gui is not opened. This is needed for headless since it can't open if there is no window manager.