How To Set Up A Minecraft Server On CentOS 7

From Human's Love
Jump to: navigation, search

This guide will show how to set up Minecraft version 1.16.5 on CentOS 7 64bit. It has handy startup and shut down 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 our prerequisite software:



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.



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:



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 see if the other half of this setup works.



Example Output



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



The final step of the basic setup is to open the default Minecraft port on your firewall.



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). To stop the server, simply type "stop". Once the shutdown is complete, the screen session will be terminated. 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 immediately, you can simply run "stopcraft" at 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 to give your username OP status. i only care about smiles per gallon This can be done with the following command, which you don't need to touch the screen:



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