Creating Your Own Minecraft Java Edition Server on CentOS

1 hour
  • 5 Learning Objectives

About this Hands-on Lab

Have you ever wanted to play Minecraft with your friends, or maybe your kids, but didn’t want to have to spend money to rent expensive Minecraft servers? Have you ever then thought about creating your own Minecraft server, but got intimidated by the technical steps required to do so? In this hands-on lab, you will be provided with a CentOS 7 Linux server on which you will create your very own Minecraft Java Edition server! This lab will provide clarity not just on how to create a Minecraft server, but also on some Linux fundamentals.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Prepare the Server with a Java 11 JRE and a Minecraft User Account
  1. Locate and install a Java 11 JRE.
  2. Create a minecraft user account and group.
Download and Deploy the Minecraft Server JAR
  1. Create the minecraft installation directory.
  2. Change the user and group ownership of the installation directory to minecraft.
  3. Download the latest Minecraft server JAR to the installation directory.
  4. As the minecraft user, execute the server.jar to create the rest of the server files.
  5. Accept the Minecraft server EULA.
Whitelist and Grant Operator Status to Your Minecraft User Account on the Minecraft Server
  1. Enable the Minecraft server whitelist.
  2. Start Minecraft in the foreground.
  3. Grant your Minecraft account operator status (use Quartermyle if you do not have a Minecraft user account).
  4. Whitelist your Minecraft account (use Quartermyle if you do not have a Minecraft user account).
  5. Stop the Minecraft server.
Create a systemd Service for Your Minecraft Server and Enable On-Boot Startup
  1. Create the systemd minecraft service file.
  2. Enable the Minecraft server to start on system boot.
  3. Start your Minecraft server using systemctl.
(Optional) Join Your Minecraft Server Using the Minecraft Game Client
  1. Start your Minecraft game client with the same version of Minecraft as your server.
  2. In the "Multiplayer" menu, add a new server using the public IP address of your lab server.
  3. Join your Minecraft server.

Additional Resources

You and a few of your friends want to play Minecraft together, but don't want to spend a bunch of money to rent a Minecraft server. To solve this problem, you are going to create your very own Minecraft server on Linux!

For this, you have been provided with a CentOS 7 Linux server on which you will need to install a Java 11 JRE and deploy the latest Minecraft server JAR file to /opt/minecraft as the minecraft user. Once you have your Minecraft server deployed, you will want to grant your Minecraft account operator status and enable the server whitelist (don't forget to whitelist your account!) to ensure that only white-listed user accounts can join your server. If you do not have a Minecraft account, then you may use the Quartermyle account when granting permissions and whitelisting.

Finally, you will need to create a systemd service for your Minecraft server so that the Linux operating system can properly manage your Minecraft server instance. The minecraft service should run as the minecraft user from the /opt/minecraft directory with 2 gigabytes of allocated memory, automatically restart on failure, and automatically start when the system boots.

Once you have created your Minecraft server, you may optionally open up the Minecraft game client on your local machine and use it to join your Minecraft server. If you do not have a purchased and installed copy of the Minecraft game client, then you may skip this step.

Helpful Links:

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?