User description

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 important to know that this server won't be able hold many people. From my experience, anything over five people and the server will start to get a bit wonky. The optimal number of people was between two and three. However, this can be increased by tweaking the server. We are also going to be using the spigot version of Minecraft as the default install didn't work for me. It crashes frequently, is slow and unstable, and can even crash a lot. The official Java version may improve in the future. We will be using Java that should already exist on the Raspberry Pi (if Raspbian is the full version). 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 Check out my video below to learn how to set up the server. Otherwise, I have a detailed text explanation immediately below the video. If you enjoy the video, please subscribe to our YouTube channel or follow us on Facebook so we can keep you up-to-date. Setup the Raspberry Pi Minecraft Server First, we need to install Raspbian on the Raspberry Pi. If you haven’t yet done this, please check out my amazing guide on installing NOOBs Raspberry Pi. It will walk through all the steps required. Important: Raspbian Buster must be up-to-date. If Java isn't installed, then this will cause the server not to work. I recommend that you update to Jessie or Stretch, or Buster. In this tutorial, we will work entirely in the terminal. It is probably best to just boot into the terminal and not load the GUI. 1. First, let's bring Raspbian up to the latest version by entering 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, go to Advanced Options->Memory Split. Update this to 16. This will allow for more memory to be free for the server. 4. Also, you don’t wish to boot into Raspbian desktop. Make sure the boot option has been set to the CLI. This will give your server the best possible processing power. 5. If possible, increase the speed of your overclocking. 6. Finally, enable SSH to allow remote access to the Pi if necessary (unless you have it already enabled). 7. Now, restart and finish. 8. We will now want the IP address of our Pi for when we try to connect to our server. To get the Raspberry Pi IP address, enter the hostname command. To ensure that the IP doesn't change you might want to setup a static IP address. 8. Next, we need to make sure that Java and Git is installed. Without Java and Git, we won't be capable of building or launching the server. Enter the following command and you will be able to install both the Raspbian default JDK package as well as the Git application. 9. Now we need the Minecraft server files. To do this, we will use the Spigot builder tool. 10. Now we will want to run the build tools file, so it creates our Spigot server. It should take between 15 and 30 minutes to complete. To obtain the latest version, add --rev 1.4.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 B+, B or any variation before the Raspberry Pi 2, then the build tools will likely fail. Instead, you will need to generate the spigot.jar using a faster 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. Now, let's launch the server. 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. To do this, open the Eula and type the following command. 13. Change false to TRUE in this section. Save and exit by pressing CTRL+X, then Y. 14. Now relaunch the server, it will take a while to create a map so give it about three to five minutes. If you ever reboot again, it will only take thirty seconds to load if the map has already been created. 15. The server should now run and be accessible over the local networks. 16. Gslist Modifying your user is a good idea. This will allow you to use all server commands when you log into the server. Accessing the server backend will be slightly more difficult if it is set to auto-boot at startup. You can modify your user by running the following command after the server has launched: (Replace username with your username) 17. The Minecraft server on the Raspberry Pi will now be up and running fine, but you may want to do some optimizations to the server to make it run even better. Connecting to 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. Here are some steps to verify your connection. Load the Minecraft Java client onto a computer that is part of the same local network as your Pi. Go to multiplayer, and your server might appear in the list. If it doesn’t, go to direct connect and enter your IP address using the command hostname-I. Port forwarding is necessary if you wish to allow access to Minecraft servers via the internet. Assuming 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. Here are some tips to configure the server and get it up and running. Optimizing the Minecraft Server To get the best out of our Raspberry Pi Minecraft server, we will install a plugin that optimizes the performance. First, let's install NoSpawnChunks. This will help to prevent the Minecraft server taking up too much RAM. 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 You will now want to know how you can edit the server property. This ability is vital for optimizing the server, customizing it to your liking, and ensuring that it runs smoothly. You can find detailed information on each server setting here. Enter the following line to gain access to 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 There are a few more steps that we need to take in order for the server to begin on boot. 1. We will need the service file to be created for Minecraft server. Enter the command below to get started. 2. Gslist This file will contain the following text. This file defines the services, so the service manager understands how and what to 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. You can enable the service by running the command below. 4. 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. You can stop the server by using the following command. Your server should now start on boot. You can test it by restarting the Raspberry Pi. It will take about a minute to start. If you need to access the server from the command line you will need the following steps: Shut down the server, and then load it using normal commands. I hope you found this tutorial helpful in setting up a stable Raspberry Pi Minecraft server. If you liked this tutorial then please visit our other Raspberry Pi Projects. Also, feel free to drop us a comment below if you have better optimization settings, plugins, or ideas. Let us know if you have any problems.