How To Set Up A Minecraft Server On CentOS 7

How To Set Up A Minecraft Server On CentOS 7


This guide will help you set up Minecraft (version 1.16.5), on CentOS7 64bit. It includes handy shutdown and startup scripts to make management easy.



 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



First, we install our prerequisite program:



Now, we will create and enter the directory in which 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, create a script that allows you to start the server with no need to remember any screen CLI syntax.



Depending on how large your server is, you might want to adjust the values of "Xmx" or "Xms". These are the amount of RAM allocated to the Minecraft server instance. Mojang recommends 1GB RAM for Minecraft server instances. You can use less if you have very few users. 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 verify that this part of the setup is functioning.



Example Output



Now you should see text indicating that the server is currently starting/has begun. To disconnect from the screen, use Control +A then D.



We will now close the default Minecraft port on our firewall. This is the final step in the basic setup.
Memes rain



To gracefully end the server processing, we will need to enter a screen session.



 Although we are not at a prompt, we can still type Minecraft server commands here (/give, /op, etc). Simply type "stop" to stop the server. After the shutdown is completed, the screen session ends. Just type "startcraft" to run the server again.



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



 To stop the server now, simply 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 use any commands including "/op" while playing. Depending on your circumstances, you might need to log in to the Minecraft server before you can OP.



 If you wish to have the "startcraft" script run when the server starts, simply run this command:



 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! Contact us for all your VPS hosting requirements!