Setup Minecraft Servers on CentOS

By | October 29, 2016

1) Create your host machine and provision the setup with required RAM and CPU resources.

2) Once your server is updated and configured the way you like, there will be the need to install java and screen so that we can run the minecraft server.

$ sudo yum install screen java -y

3) Download the latest version (or your desired version) of the Minecraft server. The download page is located here:

$ wget*****/minecraft_server.******.jar

4) Run the server for the first time so that it creates the eula.txt. You can use CTRL+C to close out of it.

$ java minecraft_server.*********.jar

5) Accept the EULA agreement by editing the eula.txt file and changing the false to true on Line 3 of the eula.txt file.

6) Run the server a second time and let it generate some default terrain and spawn areas. This will also create the file as well as the whitelist.json, ops.json, and default banned-players.json.

7) Once the set up is completed, close the server out by simultaneously pressing CTRL+C on your keyboard or typing stop into the console of the Minecraft server.

8) Edit the and other configuration files to your liking.

9) Create a startup script.

$ touch

Contents of

echo -e "Starting Minecraft Server in 3 seconds.."
sleep 3
screen -A -m -d -S minecraftserver java -Xmx1024M -Xms1024M -jar /path/to/minecraft_server.1.8.1.jar nogui

Do not forget that you can edit the 1024M to account for how much RAM you want to provide to the Minecraft server.

  • 1024M for 1G of RAM
  • 2048M for 2G of RAM
  • 4096M for 4G of RAM
  • etc..

10) Make the start script executable:

$ chmod +x

11) If you are using IPTables firewall, do not forget to add the Minecraft server’s port to the firewall to allow connections. The default port for Minecraft is 25565:

$ sudo iptables -I INPUT -p tcp --dport 25565 -j ACCEPT
$ sudo service iptables save

12) Now you can start your server by running the start script. This will run the Minecraft server in a screen session in the background.

It is advisable to run the Minecraft server as a different user and not the root user.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.