[GO] [Part 1] Let's set up a Minecraft server on Linux

Introduction

This article explains how to set up a multiplayer server in Minecraft Java Edition. This time it is the first time, so I will explain up to the point of building the basic Minecraft server.

About the environment

This time we will build a server using CentOS7. I want at least 2GB of memory to use for the server. The amount of memory allocated can be changed later according to the number of people connected. Since it is a server, high GPU performance is not required.

STEP1 Preparation

First, download the necessary files.

1-1 Download Minecraft

First, download the Jar file to be placed on the server. There is an official version and a modified version such as Bukkit and Spigot, but in this article I will try to build a server using Spigot. If you have your own software, you can use it. The difference between the official version and the modified version is whether or not the plugin can be installed. Of course, if you can use the plug-in, you can take measures against vandalism, so it is recommended to use the modified version.

Download Spigot

1-2 Rename

For convenience, rename the Jar file you downloaded earlier to "spigot.jar".

1-3 Download FTP software

Here, FTP software called FileZilla is used. FTP software is software for sending and receiving files between a server and a work PC. It is mainly used here to transfer files related to Minecraft to the server.

Download FileZilla

STEP2 File transfer

Transfer the Spigot Jar file you downloaded earlier using FTP software.

2-1 Starting FTP software

After starting FileZilla, connect to the server. Enter the IP address or domain for the host (H), the user name [root] for the user name (U), and the password set for the user for the password (P). The task here is to log in to the server from the FTP software.

2-2 File transfer

This time, we will create a new directory called "Minecraft" in the "root" directory and build a Minecraft server in it. After creating and moving "Minecraft", upload the Jar file you downloaded earlier to the Minecraft directory. This completes the FTP operation.

STEP3 Install the software on the server

Now connect to the server using SSH. It can be accessed using TeraTerm for Windows and the terminal installed from the beginning for Mac.

3-1 Login with SSH

Copy and paste the following commands in order. Replace [IP address] with the IP address or domain of the server.

# ssh -l root [IP address]

3-2 Screen installation

Install Screen. It keeps Minecraft running in the background for 24 hours.

# yum -y install screen

3-3 Java installation

Then install Java. Without it, Minecraft won't work on the server.

# yum -y install java-1.8.0-openjdk

STEP4 Firewall settings

Work with the server connected via SSH. Here, we will do the port release work required to publish the server in Minecraft.

4-1 Port open

Release port 25565 required for communication with Minecraft.

# firewall-cmd --zone=public --add-port=25565/tcp --permanent

Reflect the settings by reloading

# firewall-cmd --reload

STEP5 Start Minecraft

Finally start Minecraft.

5-1 First start

Change to the directory where you placed the Spigot Jar file.

# cd /root/Minecraft/

Launch Minecraft

# java -Xmx1024M -Xms1024M -jar spigot.jar

This completes the initial startup. The necessary files are generated at the first startup.

5-2 I agree with eula.txt

If you log in with FTP software again and look at the / root / Minecraft / directory, you will find "eula.txt" in the file generated earlier. Download this file to your work PC and open it with Notepad or TextEdit.

In the bottom line

eula=false

Where it is

eula=true

Rewrite to. Save the file and replace /root/Minecraft/eula.txt with the edited file by FTP.

5-3 Start again

Make an SSH connection again.

# ssh -l root [IP address]
# cd /root/Minecraft/
# screen

The following is the Minecraft startup command, but the following command allocates 2GB (2048MB) of memory. If you want to change the amount of memory allocated, you should change this number at startup. "Xms" represents the maximum memory used, and the load on the memory can be reduced by setting "Xmx" and "Xms" to the same value.

java -Xmx2048M -Xms2048M -jar spigot.jar

5-4 Log in to the server

Prepare a Minecraft client and try entering from the PC side. Enter the IP address or domain of the server in "Server address".

5-5 Granting authority

In the initial state, no player has the authority, so execute / op [your MCID] from the console to give the authority to yourself.

5-6 Stop the server

If you want to stop the server, you can stop it with the / stop command from within Minecraft. It's basically running on the Screen, so it doesn't stop for 24 hours.

Finally

This time I used Spigot to build a Minecraft multi-server. Next time, I will play with detailed settings. Next article Click here for the second article

Recommended Posts

[Part 1] Let's set up a Minecraft server on Linux
Set up a simple local server on your Mac
Set up a Minecraft resource (Spigot) server via docker (2)
Set up a file server on Ubuntu 20.04 using Samba
Set up a free server on AWS in 30 minutes
Set up a Minecraft resource (Spigot) server via docker
Run a Linux server on GCP
Yes, let's make a Minecraft server (Oracle Linux + Spigot + Geyser)
Set up a Samba server with Docker
Build a simple WebDAV server on Linux
Set up a mail server using Twisted
Build a Samba server on Arch Linux
Set up Ubuntu as a Linux cheat sheet and https server
Set up a simple HTTPS server with asyncio
Set up a local server with Go-File upload-
Set up a test SMTP server in Python.
Set up a UDP server in C language
How to set up a local development server
Set up a simple SMTP server in Python
Set up a Python development environment on Marvericks
Set up an Objective-C 2.0 development environment on Linux
Set up Docker on Oracle Linux (7.x) with Vagrant
[Vagrant] Set up a simple API server with python
Set up a file server using samba on ZeroPi of Friendly Arm [OS installation]
Set up a file server using samba on ZeroPi of Friendly Arm [Purchased Items]
Set up a file server using samba on ZeroPi of Friendly Arm [Personal import]
Install Minecraft on Arch Linux
Set up Polyglot on Windows
Set up a web server with CentOS7 + Anaconda + Django + Apache
Set up a Google Cloud service account key on heroku
Setting up a CentOS 7 server hosted on Alibaba Cloud ECS
Let's set up a survival prediction model for Titanic passengers
A story about a GCP beginner building a Minecraft server on GCE
How to set up WSL2 on Windows 10 and create a study environment for Linux commands
Install Arch Linux on DeskMini A300
Create a Linux environment on Windows 10
Set up Python environment on CentOS
Run TensorFlow2 on a VPS server
Set up a node to do MNIST on ROS using Tensorflow
Host the network library Mirror for Unity on a Linux server
Run cron on Amazon Linux (set on Linux)
What I stumbled upon when using CodeIgniter on a Linux server
How to set up a jupyter notebook on ssh destination (AWS EC2)
Set up reverse proxy to https server with CentOS Linux 8 + Apache mod_ssl
Set up a local web server in 30 seconds using python 3's http.server
Verification of how to periodically execute a script on a Linux server on Windows
Set up a server that processes multiple connections at the same time
Rock-paper-scissors with Python Let's run on a Windows local server for beginners
Build a Pypi cache server on QNAP
Build an NFS server on Arch Linux
Install and Configure TigerVNC server on Linux
Dockerfile: Install Docker on your Linux server
Build a web server on your Chromebook
On Ubuntu Linux, set Tab to q
Create a Linux virtual machine on Windows
Run Jupyter notebook on a remote server
On Linux (Ubuntu), tune the Trackpad and set the function to a three-finger swipe
Source compile Apache2.4 (httpd 2.4.43) + PHP7.4 on Linux and build a Web server ―― 1. Apache introduction
Source compile Apache2.4 (httpd 2.4.43) + PHP7.4 on Linux and build a Web server --2 PHP introduction
Install Windows 10 from a Linux server with PXE
Open a ZIP created on Windows in Linux