How To Set Up A Minecraft Server On CentOS 7

From Pediascape
Jump to: navigation, search

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



First, we install the 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:



Accept the EULA that has been read.



The next steps are to create a handy script that allows us to start the server without remembering any arbitrary Java or screen CLI 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. You can use less RAM if you have fewer users. To modify the startcraft command, use "nano".



Now we make "startcraft" executable:



Let's now see if this half of our setup works.



Sample 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 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). Stopping the server is as easy as "stop". When it has completed the shutdown process, the screen session will terminate. Just type "startcraft", to start the server again.



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



To stop the server right away, you can run "stopcraft" any time.



You can now start and stop the server using single commands, without ever having to type java stuff or jump into the screen!



Don't forget your username OP status. You can do this without touching the screen by using the following command:



Replace "USERNAME” by your username. Flash Ants 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. Is minecraft still a thing



This command will allow you to run the "startcraft script" when the server starts. Flash Ants



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



Have fun crafting! For all your VPS hosting needs, don't hesitate to contact us!