Setting up Minecraft server on Linux based VPS

Minecraft is a sandbox game where players can build their own world. Since its establishment in 2011, the game now has 126 million active players. To further improve the gaming experience, Minecraft enthusiasts manage their own Minecraft servers. It provides more freedom and allows players to grow their communities.

Minecraft

In this article, we will go through the steps it takes to set up a Minecraft server on Linux-based VPS so you, too, can have a better Minecraft experience. Let’s get started.

What is a Minecraft Server?

A Minecraft server is a multiplayer game server for the video game Minecraft. Minecraft servers allow players to play with other people online or via a local network.

There are various server types in Minecraft, which are:

  • Minigame. The servers host multiple minigames, ranging from Spleef to Capture the Flag.
  • Anarchy. There are no rules in the Anarchy server. Players have the flexibility to do anything they want.
  • Survival. The servers only use Survival mode. It’s similar to the Anarchy server, but with rules.
  • Creative. In Creative servers, players can construct anything they want with other players, but to a certain extent.
  • Faction. Similar to the Creative mode. However, players in Faction can claim the land and restrict other players from building on the land.
  • Personal. In Personal mode, players can build their own server, and the link is shared only with certain players or close friends.
  • Hardcore. This mode is similar to Survival, but players only have one life. It’s “the last man standing” type of play.
  • Roleplay. Players follow certain scenarios that are happening. Players act as their own persona.
  • Pay-to-win. As the name implies, players can gain and purchase advantages for real-world money.

Players are free to choose between using the default Minecraft server provided by the developer, Mojang Studios, or setting up their own server.

Setting up your own server needs resource planning that includes:

  • A Windows 10 desktop or server.
  • A minimum 4G of RAM.
  • A stable, wired internet connection.
  • Internet plan with enough bandwidth.

The best solution to the requirements above is using a VPS for your Minecraft server, which brings us to the next part.

Benefits of Using a VPS for Minecraft

A VPS, or Virtual Private Server, simulates a dedicated server scenario even though it’s still a shared hosting environment. With VPS, you don’t share your CPU, RAM, and any data with other users.

Using VPS works best when hosting large websites and game servers. Minecraft is one of the games that can benefit from VPS. Some of the benefits include:

  • Cost-effective. VPS offers a more affordable price than dedicated hosting, which works well with Minecraft’s target audience.
  • Quick setup. This hosting type is relatively quick to set up, ranging from four to six hours.
  • More storage and bandwidth. Extra storage and bandwidth capacity results in faster server performance.
  • Full root access. Using VPS allows you full root access, which makes setting up your own Minecraft server possible.
  • Better security. VPS is relatively more secure and stable compared to dedicated servers.

How to Set Up Minecraft Server on Linux-Based VPS?

Now, let’s get into the steps to set up a Minecraft server on Ubuntu or CentOS. The steps are similar with slight command differences.

1. Prepare the server.

After acquiring your VPS hosting plan, prepare the server by connecting to your hosting via SSH.

To do so, open the SSH terminal and run the command below:

ssh username@host_IP_address

After that, type in your password and hit Enter.

You can install PuTTY to help with the process.

PuTTY is an open-source and widely-used terminal simulator. However, you can use your preferred simulator.

2. Install Java.

The next step is installing the Open Java Development Kit (OpenJDK). Use your Root privilege from your VPS to download Java. The next part shows how to install Java on Ubuntu and CentOS.

Install Java on Ubuntu:

First, update the repository to ensure you have downloaded the latest version of OpenJDK. Enter the following command:

sudo apt update

Then, add the following command to install the latest Java Development Kit:

sudo apt install default-jdk

Confirm the installation by entering y (yes) and press Enter.

Run this command to check if Java is installed on your server:

java -version

Install Java on CentOS:

Update the repository and enter the following command:

sudo yum update

Then, install the latest Java Development Kit:

sudo yum install java-16-openjdk-devel

Add the command below to check if Java is installed:

java -version

3. Install screen.

Screen is a console application, and it works to keep your server running even when you’re not connected.

Run this command to install Screen on Ubuntu:

sudo apt install screen

Run the following command to install screen on CentOS:

yum -y install screen

4. Create a directory for Minecraft files.

This is where you will store all the Minecraft files and keep them organized. To do so, run the following command:

mkdir -p Games/Minecraft or mkdir minecraft

Then, you can move into the new directory with:

cd minecraft

5. Install Minecraft server files.

Before installing, check Minecraft’s latest version by going to their official webpage.

Then, install wget to help with the installation. Use the following command:

Ubuntu users:

sudo apt install wget -y

CentOS users:

sudo yum install wget -y

After that, go to the Minecraft download page, right-click on minecraft_server, and copy the link address.

Then, use wget to download the Minecraft files:

wget https://launcher.mojang.com/v1/objects/35139deedbd5182953cf1caa23835da59ca3d7cd/server.jar

When the download is finished, run the server.jar file using the command below:

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

Next, accept the end-user license agreement by changing the eula.txt. Do it with Nano text editor:

sudo nano eula.txt

Then, change the line eula=false to eula=true. After that, save and close the file.

6. Run screen.

After downloading and installing the Minecraft server, now try running Screen. To do so, type the following command:

screen -S “Minecraft server”

7. Run Minecraft server.

Now, it’s time to run your Minecraft server. To do so, first rerun the java command and execute the jar file:

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

After that, you’ll get a message when it’s up and running.

When it’s running, you can close the SSH or press ctrl+a+d to close the Minecraft screen. If you need to continue the screen session, press ctrl+r to re-open it.

After reaching this step, your Minecraft server should be successfully up and running on Linux.

8. Point a domain to your Minecraft server.

If you’re using a custom domain, the last step is to point it to your Minecraft server. Use these values for your A record:

  • Host: @
  • Value: IP address of your Minecraft server
  • TTL: Automatic or 30 minutes

Lastly, wait for at least 30 minutes up until 24 hours for the DNS changes to happen.

Conclusion.

Minecraft is a game by Mojang Studios with players around the world. This article recommends using a VPS to fully enjoy Minecraft as it comes with many benefits, like cost-effectiveness and better security.

In addition, we’ve covered the eight steps to setting up a Minecraft server on Linux-based VPS, which are:

  1. Prepare the server
  2. Install Java
  3. Install Screen
  4. Create a directory for Minecraft files
  5. Install Minecraft server files
  6. Run Screen
  7. Run Minecraft server
  8. Point a domain to your Minecraft server

Follow the steps to start playing Minecraft on your own server. Good luck!

Published by AtulHost

Creator of AtulHost. An ardent Linux user. Comes from a business management background. Loves to do research on modern business insights and technological solutions.

Leave a reply

Required fields are asterisked and email address will not be shared.