How To Set Up A Minecraft Server On CentOS 7



This guide will walk you through setting up a Minecraft (version 1.16.5) server on CentOS 7 64bit with nifty startup and shutdown scripts for easy management.



A CentOS 7 64-bit server, if you do not have a server then spin up a super fast Minecraft server today!



Setting up a Minecraft Server on CentOS 7



We first install our prerequisite software.



Now we need to create and enter the directory where the server will reside:



Next, we download the actual Minecraft server application and make it executable:



Agree to the EULA that you definitely read:



Next, we will create a handy script to allow us to start the server from scratch without having to remember any screen CLI syntax or Java.



Depending on the size and configuration of your server, you may need to adjust "Xmx", "Xms" and other values. These are the amount of RAM allocated to the Minecraft server instance. Mojang recommends 1GB RAM for Minecraft server instances. You can use less RAM if you have fewer users.CITIZENSNPCS To edit the startcraft command, you can use "nano" if you need to upgrade the server in the future.



Now, we can make "startcraft" practical:



Let's see if the other half of this setup works.



Exemple Output



You should now see text indicating the server is/has started. To remove the screen, use Control + A and then D.



The last step of the basic setup involves opening the default Minecraft port to the firewall.



To gracefully stop the server process, we need to enter the screen session.



Although we are not at a prompt, we can still type Minecraft server commands here (/give, /op, etc). To stop the server, simply type "stop". The screen session will end when it completes the shutdown process. To start the server again, type "startcraft".



You can also create a simple script which will insert the "stop command to the screen session.



To stop the server, just run "stopcraft", anytime.



You can now easily start or stop the server by using single commands.



Remember to change your username's OP status. You can do this without touching the screen by using the following command:



Replace "USERNAME with your username. Once you have it, you can perform any commands including /op while in-game. Depending on your circumstances, you might need to log in to the Minecraft server before you can OP.



This command can be used to activate the "startcraft" script when the server is started.



The next step you will likely want to take is to point a DNS record to your server's IP for easy connecting/distribution. You can read about using our cloud DNS manager here: https://www.atlantic.net/community/howto/manage-cloud-dns-records/



Finished! This page details all of the options you can modify in your "/Minecraft/server.properties" file: http://minecraft.gamepedia.com/Server.properties



Happy crafting! We are available for all your VPS hosting questions!