Raspberry Pi as minecraft server
Minecraft is a very innovative game. It has big game worlds, lovely graphics and nearly infinite blocks to set. So you can be very creative. I also wanted to create my own world. So I created my own minecraft server…on my raspberry pi.
Minecraft was created with Java, so you really need a virtual machine to run the game. Java is normally not installed on a raspberry pi, so the first step is to install a java vm. First we check which Java vm version we have:
If Java is not installed, then you will get an error message. We want to install the Java SDK. Currently version 7 is available, but this version is not a good one. So if you do not want to run into problems, you should install version 6 of Java 1.6:
sudo apt-get install openjdk-6-jre
You can find the minecraft server on the homepage. There we copy the link and use it to get it from console mode. At your raspberry pi you can download the server on command line with this command:
You can do configuration in the server.properties file. You can find this file after your first server start in the same directory as the server JAR file. For this we have to start our minecraft server. You can do it from command line with this command:
java -Xms32M -Xmx256M -jar minecraft_server.jar nogui
Here we set some params. First we do not want a gui, so we set a nogui to run it on command line. We also have to set some settings for your RAM memory. Your raspberry is very limited to memory. You may only have 512 MB RAM, so we have to inform our vm, that it should use 32 MB and a maximum value of 256 MB. If you don’t limit the memory size, you will fall into serious problems. If the raspberry starts to swap memory to your SD card the game would get really really slow.
After the start up you should find your server in local LAN. If you also want to play over internet, you can also set up your router to do that. Look at my article about the FreeCiv Server. There you find the solution. You only have to change the port to 25565.