Raspberry Pi Minecraft
A Raspberry Pi Minecraft Server is a cost effective way to have your very own private server with your friends or just for stuffing around on.

I have had mine running for quite some time now and haven’t come across too many problems. It is very important to know that this sever will not be able to hold many people. From my experience anything over 5 the server starts to get a bit wonky.

We are also going to be using the spigot version of Minecraft as the default install didn’t really work for me. I found it crashed a lot, lagged and was very unstable.

In this project we will setup Java onto the Raspberry Pi and install the server. We will make a few changes to optimise the server for the Raspberry Pi 2 if you have one.  Also we will set it up so you can access it on the web and also reboot if the Pi goes offline for any reason.

If you want to see visually how to setup the serve then check out my video below otherwise I have a detailed text explain immediately below the video. If you like the video please make sure you subscribe to channel so you stay up to date.


Please find below the equipment I used for making this Raspberry Pi Minecraft server.


Setting up the Raspberry Pi Minecraft Server

Firstly, we will need to install Raspbian onto the Raspberry Pi. If you haven’t already done this, then check out my awesome guide on installing NOOBs Raspberry Pi. It will take you through all the steps that you will need to do.

In this tutorial we will work completely in the terminal. It is probably best we boot into straight into terminal so we save on memory.

  1. First let’s bring Raspbian up to the latest version by entering the following.
    sudo apt-get update
    sudo apt-get upgrade
  2. Now we will need to make a couple of changes in the config tool. Let’s bring the tool up by entering the following:
sudo raspi-config

(If you need more information regarding the raspi-config tool check out my guide)

  1. First let’s go to Advanced Options->Memory Split, update this to 16. (This will allow for more memory to be free for the server)
  2. Also you probably don’t want to boot into the Raspbian desktop so ensure Enable Boot to desktop/scratch goes to command line.
  3. Enable overclocking to High.
  4. Finally also enable SSH so we can access the Pi remotely if required (Unless you already have it enabled).
  5. Now go to finish and reboot.
  6. We will want the IP address of our Pi for when we try to connect to to our server. To get the Raspberry Pi IP address enter the following command:
sudo hostname -I
  1. Next we will need to install Java as the Raspberry Pi Minecraft Server need it to run. To do this we will need to get it from the Java website.(If you’re on the latest version of Raspbian (Jessie) you can skip to step 13 as Java is pre-installed on Jessie.)
sudo wget --no-check-certificate http://www.java.net/download/jdk8u60/archive/b25/binaries/jdk-8u60-ea-bin-b25-linux-arm-vfp-hflt-21_jul_2015.tar.gz
  1. Now run the following command to unzip the file into the opt folder.
sudo tar zxvf jdk-8u60-ea-bin-b25-linux-arm-vfp-hflt-21_jul_2015.tar.gz -C /opt
  1. To check that it unzipped properly and is usable run the following command:
sudo /opt/jdk1.8.0_60/bin/java -version
  1. Now we will need the Minecraft server file, we’re going to use a builder tool that is supplied by spigot, to get this enter the following commands:
sudo mkdir /home/minecraft
cd /home/minecraft
sudo wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
  1. Now we will want to run the build tools file so it creates our spigot server. It will take about 15-30 minutes to finish. Add --rev 1.9 to the end of the command to get the latest version. Don’t forget to change 1.9 in the command to the latest version number.
    Note: If you’re on the latest version of Raspbian you can remove /opt/jdk1.8.8_60/bin/ from this command and any other command that contains it).
sudo /opt/jdk1.8.0_60/bin/java -jar BuildTools.jar

Important: If you have a Raspberry Pi B+/B or any variation before the Raspberry Pi 2 then the build tools will fail. You can instead download the spigot.jar directly from file mirror using the following command:

sudo wget http://www.mediafire.com/download/pg7xzshq5cdmfjx/spigot-1.10.2.jar

If you want a previous version for some reason you can use one of the following.

sudo wget http://www.mediafire.com/download/6h09558h3ekzyd3/spigot-1.9.4.jar
sudo wget http://www.mediafire.com/download/nld0qtn49gyx723/spigot-1.9.2.jar
sudo wget http://www.mediafire.com/download/3rf1fawywqfd5g5/spigot-1.9.jar
sudo wget http://www.mediafire.com/download/kvkkxsu7ws6nhvz/spigot-1.8.8.jar
  1. To make sure the spigot server successfully downloaded and saved simply type ls and should see spigot.jar.

Make sure you remain in the /home/minecraft folder as we want all the server files to be created in here. If you start the server in a different folder it will create the files in there.

  1. Now we’re ready to launch to do this enter the following command. (You may need to change the version number depending on what version you’re using eg. spigot-1.9.jar)

Raspberry Pi

sudo /opt/jdk1.8.0_60/bin/java -Xms256M -Xmx496M -jar /home/minecraft/spigot-1.9.jar nogui

Raspberry Pi 2 & 3

sudo /opt/jdk1.8.0_60/bin/java -Xms512M -Xmx1008M -jar /home/minecraft/spigot-1.9.jar nogui

The server will stop straight away as we will need to agree to the Eula. You can do this by opening the Eula by typing sudo nano eula.txt change false to TRUE.

  1. Now relaunch the server again it will take a while to create a map so give it about 3-5 minutes. If you ever reboot it will only take 30 seconds to load if the map has already been created.
  2. The server should now be running and accessible over the local network.
  3. The Raspberry Pi Minecraft server will now run fine but we may want to some optimizations to the server to make it run even better.

Raspberry Pi Minecraft Server

Connecting to the Minecraft Server on Raspberry Pi

If you’re on a local network, then it should be pretty easy to connect to the Raspberry Pi Minecraft server. To test it out do the following:

Load up Minecraft on a PC within the same local network as the Pi.

Go to multiplayer and then your server might pop up in the local list. If it doesn’t simply go to direct connect and enter the IP we got earlier on the Pi using the command hostname -I.

If you want to allow access to the Minecraft server via the internet, then you will need to setup port forwarding.

If you want to learn how to do this, then head over to my guide on setting up Raspberry Pi port forwarding. You will need to port forward the port 25565 (Unless you change it in the server properties)to the IP of your Pi.

Configuring the Server

Optimizing the Raspberry Pi Minecraft Server

Now to get the most out of our Raspberry Pi Minecraft server we will want to install a plugin to help optimize the performance.

Firstly let’s install the NoSpawnChunks plugin, this will help prevent the Minecraft server from chewing up too much RAM.

cd /home/minecraft/plugins
sudo wget http://dev.bukkit.org/media/files/586/974/NoSpawnChunks.jar

There are other plugins out there that can help with performance, just simply use the wget command to download them to the Pi like we did above.

Editing the Minecraft properties

Now you probably want to know how to edit the server properties. This is very important for optimizing the server and customizing it to how you want the server to be. If you want more information for each of the server settings you can find a good page on them here.

To enter the server properties, enter the following:

sudo nano /home/minecraft/server.properties

Now in here we will want to change a few settings to help optimize the performance of the server. You change these and other settings to whatever you like however you want but keep in mind the Pi can’t handle too much processing.


Boot on Start Up

Let’s first start by making a simple start up script. To do this lets first create the file by entering:

sudo nano /home/minecraft-start.sh

In here simply add the following lines so that the Raspberry Pi Minecraft server will start up correctly. (Make sure the spigot version is correct)

cd /home/minecraft
sudo /opt/jdk1.8.0_60/bin/java -Xms512M -Xmx1008M -jar /home/minecraft/spigot-1.9.jar nogui

If you want the server to start up automatically on reboot then we need to simply add it to the rc.local file. To do this enter the following:

sudo nano /etc/rc.local

In here add the following line before the exit line.

bash /home/minecraft-start.sh

Once done exit and save.

Now the server should start on reboot automatically. If you want to test this simply enter the following:

sudo reboot

To check if the script is running either try to load the server in Minecraft or in the terminal of your Pi enter:

ps aux | grep "minecraft-start.sh"

This will return two results you only need to pay attention to the first.

If you need to kill the process get the process id from the above command, it is the first number after the username (In this case it should be root).

To kill the process simply enter the following (Replacing {pid} with process id):

sudo kill {pid}

I hope this tutorial has help you in setting up a stable version of a Raspberry Pi minecraft server. If you like this tutorial be sure to check out our many other Raspberry Pi Projects.

Also feel free to drop us a comment below if you have better optimization settings, plugins or ideas. Also if you’re having trouble let us know below.

The Raspberry Pi Crash Course

The Raspberry Pi Crash Course

Enter your email address below to get the

Raspberry Pi crash course delivered straight to your inbox

Please check your inbox for a confirmation email!