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. No Pesos 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 create and enter the directory that the server will reside in:



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



Accept the EULA that has been read.



Next is to create a handy script which allows us to launch the server without needing to remember any screen CLI or Java syntax.



You may need to adjust the "Xmx", and "Xms", values depending on the server's size. These are the amount of RAM allocated to the Minecraft server instance. Mojang recommends 1GB RAM for Minecraft server instances. If you have very few users, you can use less RAM. You can edit the startcraft command with "nano" if the server is to be upgraded in the future.



Now, we can make "startcraft" practical:



Now let's test that this half of the setup is working:



Sample output



You should now see text indicating the server is/has started. 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.



To gracefully end the server process, you will need to enter the screen sessions:



Although we are not at a prompt, we can still type Minecraft server commands here (/give, /op, etc). The command to stop the server is simply "stop." When it has completed the shutdown process, the screen session will terminate. To run the server once again, just type "startcraft"



Alternativly, you can set up a simple script that will inject the "stop” command into the screen session.



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



Now you can start and stop the server with single commands without ever having to type out java stuff or jump into screen!



Don't forget to give your username OP status. This can be done without touching screen with 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.



You can run this command to make the "startcraft” script run on server startup.



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! Be sure to contact us for all of your VPS hosting needs!


Created: 23/08/2022 08:53:07
Page views: 54
CREATE NEW PAGE