How to install Minecraft Server on CentOS

Minecraft is a sandbox construction game created by Mojang AB founder Markus "Notch" Persson. Gameplay involves players interacting with the game world by placing and breaking various types of blocks in a three-dimensional environment.

This tutorial takes you through the steps of setting up your own Minecraft Server on your CentOS machine. Previously we have installed the Minecraft Server on Ubuntu. (Click Here!).

Minecraft is a game developed by Mojang AB founder Markus “Notch” Persson. Gameplay includes players interacting with the game world by laying and breaking different kinds of blocks in a three-dimensional setting. Players can create creative structures, creations, and artwork on multiplayer servers and singleplayer worlds across various game modes.

Step 1. First Make sure that your CentOS system is up-to-date.

sudo yum -y update

Step 2. Create a Minecraft Server user using the next command.

sudo adduser minecraftuser

Create New Minecraft User On CentOS
Create New Minecraft User On CentOS

Step 3. Set a password to the newly created Minecraft Server user.

sudo passwd minecraftuser

Set Password To New Minecraft User On CentOS
Set Password To New Minecraft User On CentOS

Step 4. Add the Minecraft user to the wheel group to be able to run privileged commands.

sudo usermod -aG wheel minecraftuser

Add Minecraft User To Wheel Group On CentOS
Add Minecraft User To Wheel Group On CentOS

Step 5. Now let’s switch to the Minecraft user.

su - minecraftuser

Switch To Minecraft User On CentOS
Switch To Minecraft User On CentOS

Step 6. Download and install the java OpenJDK package using the following command.

sudo yum install java-1.6.0-openjdk

Install Java OpenJDK package On CentOS
Install Java OpenJDK package On CentOS

Step 7. Check the java version to make sure that the installation was successful.

java -version

Check Installed Java Version On CentOS
Check Installed Java Version On CentOS

Step 8. Install the “wget” package if it is not already installed.

sudo yum install wget

Install wget Package On Centos
Install wget Package On Centos

Step 9. Create a Minecraft directory to hold and keep the Minecraft Server files.

mkdir minecraftdir

Create A Minecraft Directory On CentOS
Create A Minecraft Directory On CentOS

Step 10. Move to the newly Minecraft directory.

cd minecraftdir

Move To New Minecraft Directory On CentOS
Move To New Minecraft Directory On CentOS

Step 11. Download the Minecraft Server using the next command. You can check for the latest Minecraft Server release from Minecraft official website (Click Here!!). Then replace the below link with the newest Minecraft Server release.

wget -O minecraft_server.jar https://s3.amazonaws.com/Minecraft.Download/versions/1.11.2/minecraft_server.1.11.2.jar

Download Minecraft Server On CentOS
Download Minecraft Server On CentOS

Step 12. Set permissions on the downloaded file to be executable.

chmod +x minecraft_server.jar

Set Permissions On Minecraft Server Downloaded Files On CentOS
Set Permissions On Minecraft Server Downloaded Files On CentOS

Step 13. Create the License agreement file “eula.txt.”

vi eula.txt

License Agreement File On CentOS
License Agreement File On CentOS

Step 14. Edit the “eula.txt” file and add the following line to it “eula=true.” It should look like the below screenshot.

Edit License Agreement File On CentOS
Edit License Agreement File On CentOS

Step 15. To let the Minecraft Server run in the background, you will need to download the “screen” package. Otherwise, you can skip to “Step 17” and start the Minecraft Server.

sudo yum install screen

Download and Install Screen Package On CentOS
Download and Install Screen Package On CentOS

Step 16. Start the “screen” package using the next command.

screen

Step 17. Now let’s start the Minecraft Server with the following command. In this command we will run the Minecraft Server by allocating 1024MB memory, in case you need to change this then replace the “-Xmx” and “-Xms” parameters with the desired size.

java -Xmx1024M -Xms1024M -jar minecraft_server.1.11.2.jar nogui

Start The Minecraft Server In Background On CentOS
Start The Minecraft Server In Background On CentOS

Step 18. If you are running the Minecraft Server in the background, then you can detach the current screen using the next command.

screen -r 
OR
CTRL+A+D

Step 19. To stop the Minecraft Server use the stop command.

stop

That’s it for now. In this tutorial, we have shown you how to install and configure the Minecraft Server on your CentOS machine.

Hend Adel
Hi! I'm Hend Adel, a freelancer technical geek with successful experience in Database, Linux and many other IT fields. I help to build solutions to suit business needs and creating streamlined processes. I love Linux and I'm here to share my skills via FOSS Linux! Thanks for reading my article.

1 COMMENT

  1. Thank you for the tutorial!

    However, I would personally recommend _not_ giving your minecraft-server user “sudo” privileges. That way, if the server were to become compromised through a vulnerable mod, the attacker wouldn’t immediately have access to “root” privileges off the bat.

    It’s always better to operate with the least amount of privilege possible, and I was able to remove “sudo” from the minecraft-server user with no issues.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,538FansLike
365FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

How to install CouchPotato on Ubuntu

Downloading movies and copying them over to your home server can get frustrating, especially if you are doing it daily! What if you have an option to download videos automatically, quickly, and above all with excellent quality. CouchPotato allows you to download movies easily once they are available and released automatically.

Top 20 Rsync Examples in Linux

The Rsync (remote sync) command is a Linux/Unix utility used to synchronize and copy files and directories either locally or remotely. Most Linux geeks use Rsync to mirror, backup or migrate data across folders, across disks and networks. One notable feature with the Rsync command is that it uses the "delta transfer algorithm."

Setting up NFS Server on Ubuntu Server

We have put together a detailed step-by-step tutorial that will guide you on how to install and set up NFS Server on Ubuntu so you too can start sharing data with other client systems. It is divided into sections, the first part discussing how to set up the host server and the second part showing you how to set up the client-side. For this tutorial, we will be using Ubuntu 20.04 LTS.

Crontab in Linux Explained With Examples

Crontab is the Linux equivalent of the Window's Task Scheduler. It can help you set up a task to run automatically at a regular...

The 10 Best Linux Server Distros For Home And Businesses

By the year 2020, it is estimated that there are close to 600 Linux distributions in the market. It includes both servers and Desktop versions; therefore, if you are looking for lightweight Linux distribution for your old PC or a reliable desktop version for employees in your organization, you may be overwhelmed with the number of choices for finding one for your use.

How to list the installed Packages on Ubuntu

It is only natural to start installing more and more software on your Ubuntu PC once you start using it. Similarly, it is also natural to lose track of the different packages that you have installed on your system. Eventually, you may be overwhelmed with the number of packages in your system and with the ones you hardly used.

MUST READ

Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

The 10 Best Programming Languages for Hacking

One of the significant entities we have in Cyber Security is Ethical Hacking (ETH). It is the process of detecting and finding flaws or vulnerabilities in a system that a hacker would exploit.

Best Laptops for Linux and Apps Development [2020]

Apart from your programming skills, there are a few other things that can also influence the way you code, and one of them is your computer system for sure. Even though it isn't like you can't code on a regular PC or laptop, speaking from personal experience, you can make the most out of your programming skillset by going for a computer with high specs and one that's been specially designed for such tasks.

3 Best Ways to Uninstall Software on Ubuntu

Uninstallation of programs can be done by graphical way using the Ubuntu Software Center, and the Synaptic Package manager. Command-line way of doing it is also possible using apt-get and aptitude commands. We shall discuss each one of them in detail.

Ubuntu 19.10 (Eoan Ermine) Beta Installation and Overview

It may be early, but I've been looking forward to the release of Ubuntu 19.10 for some time now. As an impatient person, and promised readers in the FOSSLinux article announcing the release of Eoan Ermine that we would provide you a review of Ubuntu 19.10 Eoan Ermine - Beta.  So, here it goes.