Minecraft Server Install on Raspberry Pi

From KlavoWiki
Jump to navigationJump to search

I used a Raspberry Pi 4 with 4 GB RAM. I also installed the 64 Bit OS which is still in beta. I used 64 Bit version so I can use more RAM for Java to increase performance.

Raspbian OS Install

I installed the 64 Bit Beta release until the Raspberry Pi Foundation officially releases a 64 Bit version of their OS.

https://downloads.raspberrypi.org/raspios_arm64/images/

Download and flash to SD card.

Default to Console not GUI

 raspi-config 

Select:

  • System Option
  • Boot
  • Console

Remove x11

Remove all the unnecessary GUI files. Not required but saves a bit of disk space.

apt remove --purge x11-common wolfram-engine libreoffice
sudo apt autoremove

Minecraft Install

Prerequisites

 apt install git openjdk-11-jre-headless 

Spigot

mkdir /opt/spigot
cd /opt/spigot
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
git config --global --unset core.autocrlf
java -jar BuildTools.jar --rev latest

Minecraft Server

If the following URL does not work you will need to go to https://mcversions.net/ and find the latest version.

mkdir /opt/minecraft
wget https://launcher.mojang.com/v1/objects/0a269b5f2c5b93b1712d0f5dc43b6182b9ab254e/server.jar -O /opt/minecraft/1.17.0_server.jar
wget https://download.getbukkit.org/craftbukkit/craftbukkit-1.17.jar -O /opt/minecraft/craftbukkit-1.17.jar

cp /opt/spigot/spigot-1.17.jar /opt/minecraft/

Run

cd /opt/minecraft
java -Xms2048M -Xmx2560M -jar spigot-1.16.5.jar nogui

EULA

The first time you run Minecraft Server, the server will start and then a short time later will stop. the server will create a number of files. You will need to edit a file to accept End-user license agreement (EULA).

 vi /opt/minecraft/eula.txt 

change

 eula=false 

to

 eula=true 

Start Minecraft Server again.

Notes

  • The rPi will run Minecraft Server but it is not ideal.
  • The CPU can't always keep up with requests and occasionally there will be a brief lag spike to the server to catch-up.
  • I don't think the 8GB model or the rPi will help as I believe it to be a CPU issue not something that RAM can address.