How To Set Up A Minecraft Server On CentOS 7

From World History
Jump to: navigation, search

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:



You have read the EULA and agree to it.



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. MINECRAFT 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. MINECRAFT SERVERS



Now "Startcraft" is possible:



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



Sample output



Now you should see text indicating that the server is currently starting/has begun. To detach from the screen, press Control + A followed by 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). Simply type "stop" to stop the server. After the shutdown is completed, the screen session ends. To start the server again, type "startcraft".



We can also set up a simple script to insert the "stop" command in the screen session.



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



Now you can easily start and stop the servers with just one command. No need to type in java stuff, or jump onto screen!



Remember to change your username's OP status. This can be done by simply touching the screen using the following command



Replace "USERNAME" with your username. Once you have it, all commands, including /op, can be performed while you are 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. Minecraft Java



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!