KNXOps Projects - Minecraft Server

2026-06-28


This project covers the setting up and configuration of a modern 24/7 Minecraft server for you and your friends.

Introduction

One of the most fun things to do with a Linux server is to run a game server for you and friends. Modern webhosting providers may offer great services but typically only allow a game server to run for a few hours per day. The main advantage of running your own server is that it can run 24/7.

The first thing you want to do is download the server.jar file from www.minecraft.net/en-us/download/server. Transfer this file to your server, place it in a directory exclusively for the server, and run one of the following commands:

java -Xmx2G -Xms1024M -jar server.jar
java -Xmx2G -Xms1024M -jar server.jar nogui
nohup java -Xmx2G -Xms1024M -jar server.jar nogui &

The first command is to run the server with its included GUI. I never found the GUI particularly useful but some people like it. The second is to run the server without said GUI. The third command is to run the server in the background using nohup. This is the command you'll want to use to have the server running 24/7, because it is not dependent on the terminal window or GUI being open to run. However, for initial trials I recommend not using nohup.

Another note is that the XMX and XMS options are to allocate RAM for the server. Mojang's website recommends providing 4G for both options, but I have found these options to be plenty for my servers, and it is important to be conscious of RAM allocation for servers. However, if you have the resources on your server and you plan to have many people on at once (>8), I would then recommend using 4G.