How to Set Up Minecraft Server on CentOS

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:-
which java

In case Java is installed, you should see its path, as follows:-
/usr/bin/java

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
mkdir Minecraft

4) Enter into this directory
cd Minecraft

5) Get the Minecraft server file from the official website:-
wget http://minecraft.net/download/minecraft_server.jar

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:-
screen

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:-
screen -r

Check this YouTube video for a detailed installation of Minecraft server on a remote CentOS system.

This entry was posted in How to and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>