How to create a Minecraft server

H

This is the game we all love and know for its simplistic yet brilliant game mechanics and blocky graphics. The server can be hosted on a number of platforms like Windows and Mac but to keep it simple, like the game itself, Linux will be our platform.

In this tutorial , you will learn how to install it in a few easy steps.

1. Pre-flight checks

  • Get a VPS Power  with Ubuntu as the operating system, from MVPS.NET. The lower variants are an option but if you intend on playing with your friends, more resources are a must-have for smooth performance.
  • Update the repositories and install screen and nano.
apt update & apt -y dist-upgrade
apt -y install screen nano

2. Install Java

Minecraft is java based so this is a critical step. Running the following command displays a list of the available packages:

apt-cache search openjdk

From the shown list, choose openjdk-8-jdk:

apt -y install openjdk-8-jdk

After the installer finishes, run the following command to ensure Java is installed properly:

java -version

3. Install the Minecraft server

A location is required to download and run the server, /home is usually the most common location and easy to access:

cd /home
mkdir minecraft
cd minecraft

And now for the server files to be downloaded in the newly created directory:

wget -O minecraft_server.jar https://launcher.mojang.com/mc/game/1.13/server/d0caafb8438ebd206f99930cfaecfa6c9a13dca0/server.jar

**The link can be found on the official page as well, in case it ever changes.

4. Start the Minecraft server

In order to start the server , you must first start screen by typing it in the console and pressing Enter at the next screen. Screen is a wonderful linux tool that allows for multiple screens of the same machine meaning you can do more than one thing at the same time with the same console.
For the server to run , the EULA agreement must be accepted:

nano eula.txt 

Set eula=false to eula=true and exit the file by saving the changes.

To start the server (with 4GB of RAM allowed) , insert the following command:

screen
java -Xmx4096M -Xms4096M -jar minecraft_server.jar nogui

After the server starts successfully, it is time to make it publicly accessible. Enter stop followed by Enter in order to stop the server and then insert the following command:

nano server.properties

Set enable-query=false to enable-query=true and then check the server with any online server status checker.

In order to leave the server running in the current screen , simply detach it by using the following key combination:

Ctrl+Alt+D

The allocated RAM can be changed in the run command. If you wish to allocate more or less ram, simply change the values of Xmx and Xms .

Voila!
You very own Minecraft server , easy to do and fun to play on.

Recent Posts

Archives

Categories