Software Development, Linux, and Windows

Notes on Software Development, Linux, and Windows

Install and run Minecraft Server on CentOS 7 Server

Create a CentOS Installation DVD

The first thing you need to do if you do not have it already is Create a CentOS Installation DVD

Install CentOS 7 Server with GUI

Follow the steps in this article to install CentOS 7, but note that you will want to use a static IP so that you can setup port forwarding to this OP address on your router for port 25565 Install CentOS 7 Server with GUI

Router and Firewall Settings

The default port that Minecraft server runs on is 25565. You will need to open this port on your CentOS Server firewall. A guide for this is forthcoming but you basically can use the GUI for the firewall settings when logged into the CentOS 7 Server as an Administrator. It is found odd the main menu under Sundry.

You will also need to setup port forwarding on your router so that port 25565 forwards to the IP address that you specified for your CentOS 7 server during installation.

Install Oracle Java 8 Runtime

Minecraft recommends using the Oracle Java installation instead of the default OpenJDK installation on CentOS. Open google on your browser and search for Java SE Runtime Environment 8 – Downloads – Oracle. Go to that page and select ‘Accept License Agreement’. Click on the link for ‘re-8u111-linux-x64.rpm’ Click OK on the dialog to use the default method of Software Install to open the file.

Ensure that Oracle Java 8 Runtime is selected as the default for CentOS 7

Follow the steps in this article to change the default version of Java Change default version of java on CentOS

Download Minecraft Server .jar file

Open the following link to download the Minecraft Server .jar file Download the Minecraft Server

Create shell script to start Minecraft Server

Using your favorite editor on CentOS, enter the following and save it to a file called startup.sh in the same directory where you placed the minecraft server .jar file. The memory settings are dependent upon your hardware and use of the server. I have a dedicated minecraft server that has a total of 8 gigabytes of RAM. Therefore I have allocated 6 gigabytes to minecraft while reserving 2 gigabytes for the OS and other tasks.

java -server -Xmx6144M -Xms6144M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=2 -XX:+AggressiveOpts -jar minecraft_server.1.11.jar

Add the executable privelage to startup.sh

chmod +x startup.sh

NOTE: The first time you start the Minecraft server it will start and immediately stop. If you look in the minecraft directory you will now see some additional files including eula.txt

Start Minecraft Server.
cd Minecraft
./startup.sh

Accept the EULA agreement

Edit eula.txt and change the line do it reads eula=true instead of false.

Whitelisting and granting ops privileges

Another important file is server.properties

If you are running you own server and only want to let certain friends have access to it, then you should change white-list=true.

Once you have these settings ready then go ahead and Start Minecraft Server.
cd Minecraft
./startup.sh

To Grant privileges, you will need to initially use the Minecraft Server Console to grant whitelist privilege to at least one user using the command ‘whitelist add username’. It is equally important to declare who has operations privileges.

From this point you can add users to the whitelist from within the Minecraft Server Console GUI or later from within Minecraft itself, using the command ‘whitelist add username’.

You can now also grant operations privilege to users by using the
command ‘op username’.