Install Minecraft Server on the Raspberry Pi (2020 Edition)
Minecraft is one of the most popular games played online, and installing your own Minecraft Server on a Raspberry Pi or other Arm powered device is easy! These instructions will allow you to install Minecraft Server on our Raspberry Pi, Raspberry Pi 3, or on our Ubuntu 18.04 Arm Server. They should also work locally on your own Raspberry Pi or other Arm powered single board computer!
To install Minecraft Server on your Raspberry Pi, just follow this quick tutorial to get you up and running!
Due to changes in the Oracle licensing, it is no longer possible to download JDK directly from their site without accepting a license agreement, as was possible in the past. Thus, it is no longer possible to just use ‘wget’ from a terminal to download JDK. Instead, you will have to use a web browser, navigate to https://www.oracle.com/java/technologies/javase-jdk8-downloads.html, and select the “jdk-8u241-linux-arm32-vfp-hflt.tar.gz” file. This will need to be accomplished in one of two ways, depending on whether you are using SSH to connect to your server, or, if you are using a local Raspberry Pi with a desktop. First, if you are using a local Raspberry Pi with a keyboard, monitor, mouse, and desktop installed, you can simply open up a web browser and visit https://www.oracle.com/java/technologies/javase-jdk8-downloads.html, and select the “jdk-8u241-linux-arm32-vfp-hflt.tar.gz” file. Take note of where it downloads, we will need that in a moment.
If you are connected via SSH, you will need to use a terminal (text only) web browser such as Lynx. This won’t be pretty, but, it should be enough to prompt for the download of the JDK file. First connect to your node via SSH using the IP address, username, and password. Then, install lynx and navigate to the Oracle website in text-only mode:
sudo apt-get install -y lynx && lynx https://www.oracle.com/java/technologies/javase-jdk8-downloads.html
Look for the text on the page where the name of the file is listed, jdk-8u241-linux-arm32-vfp-hflt.tar.gz, and press Enter to start the download. If you are on a desktop version of the Raspberry Pi, now is the time to switch to the Terminal application, and change to the directory where your file got downloaded to (most likely Downloads …
cd Downloads). If you connected via SSH, then you are already in a terminal, and can proceed.
We need to extract Java, using this command:
sudo tar zxvf jdk-8u241-linux-arm32-vfp-hflt.tar.gz -C /opt/
If the download and extract were successful, we will test to make sure Java is working by:
sudo /opt/jdk1.8.0/bin/java -version
We should see this, confirming Java is now ready (your version may vary a bit):
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b111)
Java HotSpot(TM) Client VM (build 25.0-b53, mixed mode)
Finally, let’s remove the downloaded gzip to save a bit of disk space:
sudo rm jdk-8u241-linux-arm32-vfp-hflt.tar.gz
Installing Minecraft Server
Now, it is time to download Minecraft Server!
Still in the terminal, get Minecraft from this URL:
Once it has finished downloading, we can launch it by running:
sudo /opt/jdk1.8.0/bin/java -Xmx1024M -Xms1024M -jar minecraft_server.1.15.2.jar
The original Raspberry Pi Model B only has 512mb of RAM, so it will not actually allocate 1024…but it will take approximately 400mb or so that is available to it. The Raspberry Pi 3 and our Ubuntu 18.04 LTS Arm Server both have 1gb of RAM, which definitely helps increase performance of the Minecraft Server. Of course, the Operating System does take up some of the available memory, but Minecraft Server will probably reserve about 750mb to 800mb of memory to run, which will be plenty. On a Raspberry Pi 4 you can purchase up to 4gb RAM models, so if you have one of those, feel free to experiment with increasing the value of the memory, (1024) in the above command line (perhaps 2048)
At this point, Minecraft Server will go through it’s startup routine, and you will be able to join the newly created world by pointing your game to the IP Address of your node (you can also modify game variables by editing the server.properties file, located in your ~home directory.)