Last week I elaborated on how this very website came into being. It is all thanks to a miraculous little device known as a Raspberry Pi. The Raspberry Pi is a charming little computer. First constructed as a means of providing inexpensive yet high quality technology to teach kids how to program, this credit card sized computer has developed quite the cult following. Projects vary from something as simple as a plant watering timer to a Virtual Private Network. I like to spend some of my free time playing with these little beauties if for nothing less than the pleasure of learning a new skill. Today, we are going to discuss building a fun little Minecraft server.
It was difficult and very finicky. But that was a few years ago. Since then, several generations of Raspberry Pi have been released, and they have only gotten better. While there are still some limitations, I can only have a few people on the server at one time and flying too fast for too long can cause the server to crash, I am please with my current incarnation. So I though it might be a good idea to explain how to make your own Minecraft server. As with last week’s post, let’s start with what you’ll need to get started.
- Raspberry Pi (Preferably a 3 as it is currently has the fastest processor)
- Micro USB power supply
- Micro USB (A Class 10 minimum)
- Case (Suggested to keep your Pi from being damaged, I like the one in the link because it has a detachable roof to allow better air circulation)
- Heat Sink (Suggested simply because it keeps the temperature of the board down and processing speeds up)
- SD Formatter
- Raspbian OS (I suggest using the latest version, but if you are new to the Linux you may want to try the NOOBS version)
- PuTTY (Not necessary, but useful)
- Minecraft Server software
First, you want to install SD Formatter, Etcher, and PuTTY. Use SD Formatter to format your SD card. This will erase everything and re-partition the drive. Then open Etcher, select the Raspbian image, and write it to your SD card. Once Etcher is done doing its magic, safely eject your SD card. Make sure you eject it and don’t just remove it. That can cause damage to the card. Then assemble all the components of your Raspberry Pi and power it up. For rookies, you might want to keep these commands on hand to help you use the Linux command system:
- username: pi
- password: raspberry
- startx – loads the Linux desktop
- sudo raspi-config – loads the configuration page
Once you’re powered up, it should boot directly into the desktop interface. Eventually we will set it up to boot directly into command line, but that is a little later. Right now, you want to set up you internet connection, be it through Ethernet or Wi-Fi. On the Desktop, you should make two folders:”Minecraft” and “Backup”. The Minecraft directory will hold your server and world build; the backup directory will be used to backup your build should you wish to try something new and end up not liking it. Visit the Spigot website and navigate to the latest successful build. You can do what is known as a vanilla server using the stock Minecraft software, but it isn’t as fast. Download the latest build and transfer it to the Minecraft file you made earlier. From here you’re done with the graphical interface. Now we are going to begin editing the Pi’s settings.
Open the command line program and enter the following command: “sudo raspi-config”. You are going to want to do the following:
- Expand the file system
- Change the default password. (You don’t want somebody else logging into your hardware after all)
- Change your boot option to Text Console Autologin
- Set up your keyboard and timezone preferences in “Internationalisation”
- Lower the memory allocated to the GPU to 16
- Enable ssh, otherwise known as secure shell. Then, you can login remotely.
Exit raspi-config which will cause the Pi to reboot. Once it is done rebooting, login with your username and new password. The next thing you will need to do is check you ip address. The command line can do it via the “ifconfig” command. Keep not of you IP address because this is how you are going to access the server and SSH into the Pi. You can now switch over to your other computer on the same network.
From there you will open the program PuTTY. Enter in your Pi’s IP address and remotely login. You will have to enter your username and password again. You can navigate to the appropriate directory with the following command: “cd /home/pi/Desktop/Minecraft/”. Once there you can begin building your Minecraft server and world. Use the following command to begin building your server: “java -jar BuildTools.jar”. This will take forever. Go grab a soda and watch your favorite episode of Game of Thrones.
Once the process is complete, you are going to activate the server for the first time. For this example, we are using the 1.12 version of the software, but please adjust for whichever you are using. Begin the activation with the following command: “java -jar -Xms512M -Xmx1008M spigot-1.12.jar nogui”. Don’t be surprised when the server doesn’t load. What will happen is that you will generate an EULA. You have to agree to the agreement to use the server. To do that,launch the file editor with the following command: “nano eula”. Change the word “FALSE” to “TRUE”. Save and exit. This might be a good point to mention that this is how you will edit your server properties file. You might want to consider that before proceeding to the next step.
Run the same activation command as before. Again, this will take some time because now we are building the world itself. Once you are done, try to log in to your new Minecraft world by putting in your Pi’s IP address that you made note of earlier in the multiplayer section of your Minecraft. You should be able to log in and move around. If not something has gone wrong. If you are in the your world then Congratulations! You did it. You might want to keep the following commands on hand in the event you need to access your Pi again.
- cd /home/pi/Desktop/Minecraft/
- java -jar -Xms512M -Xmx1008M spigot-1.12.jar nogui
From here you can fool around with a variety of options like port forwarding. Have fun!