Raspberry Pi Minecraft Server
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.
It has been running for a while now, and I have not encountered any problems. It is important to understand that this server cannot hold many people.
According to my experience, more than five people can cause the server to become a bit jumbled. I found the optimal amount of people is only two to three, but this can be improved upon by tweaking the server.
We'll also be using the Spigot version of Minecraft because the default one didn't work. It crashes frequently, is slow and unstable, and can even crash a lot. The official Java version may improve in the future.
Java should be installed on the Raspberry Pi by this project (if you are using Raspbian's full version).
We will make a few adjustments to optimize your Raspberry Pi 2, 3 or 4 server. We will also set it all up so that you can access it online and reboot it if it goes offline.
Equipment
Below is the equipment that I used to create this Raspberry Pi Minecraft server.
Recommendation
Raspberry Pi Micro SD Card Ethernet Cable or Wi-Fi (I recommend using an ethernet for the best network performance)
Power Supply
Optional
USB Keyboard
USB Mouse
HDMI Cable
Raspberry Pi Case
Video Tutorial
Check out my video below to learn how to set up the server. A detailed text explanation is available below the video.
If you like the video, please make sure you subscribe or follow us on social, so you're kept up to date.
Setting up the Raspberry Pi Minecraft Server
We will first need to install Raspbian onto our Raspberry Pi. If you haven’t done so already, check out my amazing guide to installing NOOBs Raspberry Pi. It will guide you through the entire process.
Important: Raspbian Buster must be up-to-date. If Java isn't installed, then this will cause the server not to work. I recommend upgrading to Jessie, Stretch or Buster.
We will be working entirely in the terminal during this tutorial. It is best to boot directly into the terminal, so that you can save memory and not load the GUI.
1. Let's start by bringing Raspbian up to date. Enter the following.
2. We'll need to make a few changes in the configuration tool. Let's bring the tool up by entering the following line.
If you need more information regarding the raspi-config tool check out our guide.
3. First, let's go to Advanced Options->Memory Split, update this to 16. This will give you more memory for your server.
4. Also, you don’t want to boot into Raspbian desktop. So make sure that the boot option is set instead to the CLI (Command Line Interface). This will give the server as much processing power possible.
5. If possible, change overclocking to High.
6. Finally, also enable SSH so we can access the Pi remotely if required (Unless you already have it enabled).
7. Now, restart and finish.
8. For when we connect to our server, we will need the IP address for our Pi. Enter the hostname command in order to obtain the Raspberry Pi IP address.
You might set up a static IP address to ensure that your IP address doesn't change.
8. Next, we must ensure that Java and Git are installed. We won't be able launch or build the server if we don't.
Enter the following command in order to install the default JDK packages for Raspbian and the Git software.
9. Now we need the Minecraft server files. This will be done using the Spigot builder tool.
10. We will now need to run build tools. It creates Spigot server. It will take approximately 15-30 minutes to complete.
To get the most recent version, add --rev 1.14.4 at the end of your command. Change 1.14.4 in your command to the most recent version number.
Important: The build tools won't work if you have a Raspberry Pi B+ or B, or any variant before the Raspberry Pi 2. You will need to instead generate the spigot.jar on a more powerful computer.
11. To ensure that Spigot has been successfully downloaded and saved, simply type ls.
Make sure you remain in the /home/pi/minecraft folder as we want all the server files to be created in here. It will create files in another folder if you start the server in a different location.
12. We are now ready to launch the server. To do this, enter the following command. (Depending on which version you're using, you might need to change the version number. spigot-1.14.4.jar)
Raspberry Pi 1
Raspberry Pi 2, 3, or 4
The Raspberry Pi 4 2GB and 4GB variants allow you to increase the Xmx values even further.
The server will be stopped immediately as we have to agree to the Eula. This can be done by typing the following command in the Eula.
13. You can change false to true here. Save the file and exit by pressing CTRL +X and Y.
14. Relaunch the server. It will take some time to create a map, so allow it to take about three to five minutes. If the map was already created, it'll only take thirty seconds to load.
15. The server should now be available on the local network and running.
16. Modifying your user is a good idea. This will allow you to use all server commands when you log into the server. If we have it auto-boot on startup, accessing the server backend is slightly more difficult.
When the server launches, run the following command: Replace your username with the following command.
17. The Raspberry Pi's Minecraft Server will now be operational. You may need to optimize it to make it run better.
Connecting with the Minecraft Server
If you're on a local network, then it should be pretty easy to connect to the Minecraft server running on the Raspberry Pi. To test it out, do the following steps.
Load the Minecraft Java Client on a computer connected to the Pi.
Your server may appear in the local list if you go to multiplayer. If it doesn't simply go to direct connect and enter the IP we got earlier on the Pi using the command hostname -I.
Port forwarding is necessary if you wish to allow access to Minecraft servers via the internet.
If you are interested in how to do it, then check out my guide on Raspberry Pi Port Forwarding. Unless you change it in your server properties, port forwarding port number 25565 will be required to the IP address of your Pi.
Here are some tips for configuring and getting the server up and running.
Optimizing the Minecraft Server
We will now install a plugin to optimize the performance of the Raspberry Pi's Minecraft server.
Install the NoSpawnChunks plugin first. This will prevent the Minecraft server's RAM from being too full.
There are other plugins out there that can help with performance or extend the servers functionality, simply use the wget command to download them to the Pi as we did above.
Modifying the Minecraft Properties
Now you probably want to know how to edit the server properties. This ability is vital for optimizing the server, customizing it to your liking, and ensuring that it runs smoothly.
You can find more information about each server setting on this page.
The following line will allow you to enter the server properties.
Now in here, we will want to change a few settings to help optimize the performance of the server.
You can change these and other settings however you like, but keep in your mind that the Pi can't process too much.
Startup Bootcamp
We will need to take a few additional steps in order to get the server to start on boot.
1. We will need a service to run Minecraft. Let's begin writing the service file below by entering the command.
2. This file will contain the following text.
This file is used to define the service and allows the service manager to know how and when it should be run. When you upgrade, don't forget about updating the spigot version number.
Once you're done, save the file using CTRL + X followed by Y and ENTER.
3. Now, we must enable the service. The command below will enable the service.
4. Minecraft Blog The following command should allow you to start the Minecraft server.
5. Using a similar command, you can check on the status of the service. This is a great way to debug.
5. The following command can be used to stop the server.
Now your server should be ready to go. You can check it by restarting Raspberry Pi. It will take about a minute to start.
You will need to shutdown the server to gain access to it via the command-line. Then, you can load it with the normal command.
I hope this tutorial helped you set up a stable Raspberry pi Minecraft server. If you liked this tutorial, please check out our other Raspberry Pi Projects.
Also, feel free to drop us a comment below if you have better optimization settings, plugins, or ideas. If you have any questions, please contact us below.