Raspberry Pi Minecraft Server

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.

I have mine running for quite some while now and have not had to face any problems. It is very important to know that this server will not be able to hold many people.

According to my experience, more than five people can cause the server to become a bit jumbled. The best number of people I have found is between two and three. But, you can tweak the server to make it more efficient.

We will also be using the spigot Minecraft version as the default installation didn't work for us. I found that it will crash a lot, be laggy, and is very unstable. The official Java version will likely improve over time.

In this project, we will utilize Java that should already be installed on the Raspberry Pi (If you're using the full version of Raspbian).

We will make a few adjustments to optimize your Raspberry Pi 2, 3 or 4 server. We will also set it up so you can access it on the web and reboot if the Pi goes offline for any reason.

Equipment

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

Recommendation

Raspberry Pi Micro SD card Ethernet Cable or Wi Fi (I recommend an ethernet to get the best network performance).

Power Supply

Optional

USB Keyboard

USB Mouse

HDMI Cable

Raspberry Pi Case

Video Tutorial

You can watch my video below to learn more about how to set up the server. Otherwise, I have a detailed text explanation immediately below the video.

If you enjoyed the video, please subscribe or follow us socially to keep up with what's happening.

Installing the Raspberry Pi Minecraft Server

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

Important: Raspbian Buster will require you to have the most recent version installed. If not, then you will find that Java is not installed, this will need to be done if you wish to get this server working. I highly recommend that you upgrade to Jessie Stretch, Buster, or Buster.

This tutorial will be done entirely in the terminal. It is probably best to just boot into the terminal and not load the GUI.

1. Let's first bring Raspbian up-to-date by entering the following.

2. We will now need to make some changes to the config tool. Let's start the tool by entering the following line.

Minecraft-server-list

Our guide contains more information about the raspi-config tool.

3. Let's start by going to Advanced Options->Memory Split. Change this to 16. This will allow the server to have more memory.

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, increase the speed of your overclocking.

6. Finally, also enable SSH so we can access the Pi remotely if required (Unless you already have it enabled).

7. Now, go to the end and reboot.

8. We will now need the IP Address of our Pi in order to connect with our server. Enter the hostname command in order to obtain the Raspberry Pi IP address.

A static IP address is a way to make sure that your IP address does not 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 to install the default JDK package for Raspbian as well as the Git software.

9. Now we need the Minecraft server files. To do this, we will use the Spigot builder tool.

10. We will now need to run build tools. It creates Spigot server. It will take about 15-30 minutes to finish.

To get the latest version, add --rev1.14.4 to the end. Do not forget to change 1.14.4 at the end of the command to the latest number.

Important: If you have a Raspberry Pi A+, B, or any other variation of the Raspberry Pi 2, then the build tool will likely fail. You will need to create the spigot.jar instead on a more powerful machine.

11. To check if the Spigot server has been successfully downloaded, use ls.

We want all server files to be created in the /home/pi/minecraft/ folder. 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 the version you are using, you may need to modify the version number. spigot-1.14.4.jar)

Raspberry Pi 1

Raspberry Pi 2, 3, 4,

You can increase the Xmx value with the Raspberry Pi 4's 2GB and 4GB versions.

The server will be stopped immediately as we have to agree to the Eula. This can be done by entering the following command into the Eula.

13. Change false to TRUE in this section. Save and exit by pressing CTRL+X, then Y.

14. Relaunch the server. The server will take a few minutes to create a new map. Give it three to five hours. If you ever reboot again, it will only take thirty seconds to load if the map has already been created.

15. Now, the server should be up and available over the local network.

16. You might want to mod your user now so that you can use all the server commands when you log in. If we have it auto-boot on startup, accessing the server backend is slightly more difficult.

To mod your user, simply run the following command when the server has launched (Replacing username with your username).

17. The Raspberry Pi's Minecraft server will now be running perfectly. However, you might want to optimize the server to make it even more efficient.

Connecting with the Minecraft Server

If you're connected to a local network it should be very easy to connect with the Minecraft server running on your Raspberry Pi. Here are some steps to verify your connection.

Load the Minecraft Java clients on a computer in the same 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.

Port forwarding is necessary if you wish to allow access to Minecraft servers via the internet.

If you are interested in learning how to do this, please visit my guide on Raspberry Pi port forwarding. Port forwarding port 25565 to your Pi is required, unless you change it in server properties.

Here are some tips to configure the server and get it 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.

You can also download other plugins that will improve performance or extend server functionality. Just use the wget command as we did above to download them to your Pi.

Modifying the Minecraft Properties

Now you will probably want to be able to edit the server properties. This ability is vital for optimizing the server, customizing it to your liking, and ensuring that it runs smoothly.

Here are more details about each of the server settings.

Enter the following line to access the server properties.

Here are some settings that can be changed to improve the performance of the server.

These and other settings can be modified however you'd like. However, the Pi cannot process too much.

Startup Bootcamp

To have the server start on boot, we will need to do a few extra steps.

1. We will need a service to run Minecraft. Let's begin writing the service file below by entering the command.

2. You will need to enter the text below into this file.

This file defines the service so that the service manager can know how and what to do. Don't forget to update the spigot version number whenever you upgrade.

Once you're done, save the file using CTRL + X followed by Y and ENTER.

3. Now, we need to enable it. You can enable this service by running the following command.

4. You should now be able to start the Minecraft server by simply using the following command.

5. You can check the status of the service by using a similar command. Checking the status is great for debugging.

5. The following command can be used to stop the server.

Your server should now start on boot. It is possible to test it by restarting your Raspberry Pi. It will take a few minutes to startup.

If you want to get access to the server on the command line, then you will need to shutdown the server and load it using the normal command.

I hope this tutorial helped you set up a stable Raspberry pi Minecraft server. If you like this tutorial, then be sure to check out our many other Raspberry Pi Projects.

If you have any suggestions, plugins, or optimization settings that are better, please leave a comment below. If you have any questions, please contact us below.

Report Page