If you have a computer running CentOS, then follow the steps below to set up a Minecraft server.
1) Java installation – Check whether Java is installed on the computer, by typing the following at the terminal prompt:-
In case Java is installed, you should see its path, as follows:-
Else, install it by typing the following:-
yum install java
You might be shown the download file size and asked if it is OK, to which you type Y.
2) Screen installation – You will need a program called Screen. This program allows applications to continue running on Linux, even if their windows (SSH sessions) are closed. To install this, type the following:-
yum install screen
Here again, you might be asked if it is OK to download, and again you need to type Y.
3) Make a directory for Minecraft
4) Enter into this directory
5) Get the Minecraft server file from the official website:-
6) This jar file needs to be given the permissions for running. To do this type:-
chmod +x minecraft_server.jar
7) Enable the Screen session, by simply typing:-
8.) Start the Minecraft server by typing:-
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
‘Xms’ is the initial memory assigned for running the program. ‘Xmx’ is the maximum memory assigned. Here, it is 1024MB or 1GB for both. You can assign more memory in case your RAM is bigger. However, ensure that these values never exceed your RAM capacity. ‘nogui’ indicates that there will be no user interface. In case you want the user interface, omit ‘nogui’ from the command.
Your Minecraft server has now started. Wait till you see ‘Done’ before doing anything else.
9) Exit from this screen session by pressing Ctrl + A + D
Note that Minecraft server will still be running in the background.
10) In order to connect back to the screen type:-
Check this YouTube video for a detailed installation of Minecraft server on a remote CentOS system.