Using the Raspberry Pi as a Minecraft server

Creating a Connection

Once the server is started, you should invoke Minecraft as a game and open the multiplayer mode by selecting the entry Multiplayer from the main menu. Multiplayer mode automatically searches for active Minecraft servers in the network (Figure 3).

Figure 3: The Minecraft client automatically searches for Minecraft servers in the network.

If the automatic scan does not find an active server, you should use Direct Connect to specifically select the Rasp Pi server via its IP address and the corresponding port 25565. Alternatively, you can add the server permanently to the list of selections using Add server. Once connected, you can log in with Join Server.

The server reports a successful user login by displaying User <Name> authenticated with UUID <random ID>. As soon as a user joins a game or ends it, the protocol will display additional helpful reports (Listing 6). In this way, you will be able to see in real time whether everything is working on the server. You will not be able to detect much of the underlying Raspberry Pi while in the Minecraft client. Instead, you are immediately inside the game and able to start playing (Figure 4).

Listing 6

Helpful Reports

[14:14:17] -- Loading Plugins --
[14:14:17] Initialized ChatLog v.3
[14:14:17] Initialized Core v.15
[14:14:17] Initialized TransAPI v.1
[14:14:17] -- Loaded 3 Plugins --
[14:14:17] Startup complete, took 1036ms!
[15:05:49] User <Name> authenticated with UUID \
[15:05:49] Player <Name> has joined the game
[15:13:53] Player <Name> has left the game
Figure 4: You have to look carefully before you realize that the game is running on a server that is a Raspberry Pi.

External Connections

The Raspberry Pi is now functioning as an energy-efficient Minecraft server in the local network. However, if you want the server to be available for friends and acquaintances, you will typically need to transmit data from your WiFi router to the Rasp Pi server. Using a Fritzbox router as an example, we explain this process step by step. Most other routers have similar functionality, but you should count on figuring out any differences as you go along.

First, you need to make sure that the router always allocates the same address to the Raspberry Pi. You can do this by opening the settings for the Home Network in the web front end from the sidebar and choosing the editor icon that is to the right, next to the entry for your Raspberry Pi. In the subsequent dialog, you will use the option Always assign this network device the same IPv4 address to indicate that the router should equip the Rasp Pi with a static IP address (Figure 5).

Figure 5: The router needs to allocate a static IP address to the Raspberry Pi as a pre-condition for the port forwarding.

Then, you can set up the forwarding from port 25665/TCP to port 25565 of the Minecraft Rasp Pi via Internet | Permit Access | Port Forwarding (Figure 6). The corresponding dialogs appear as soon as you select the Other applications option next to the Port forwarding enabled for checkbox. This is how the port is forwarded. However with this setup, you would regularly have to communicate a new static IP address to fellow players in case the connection to the Internet is interrupted. With most Internet service providers, particularly those offering DSL connections, a new static IP address is allocated every 24 hours because of regular service interruptions and subsequent reconnection.

Figure 6: You should forward port 25565 TCP to the Raspberry Pi to operate a Minecraft server accessible from the outside.

This issue can be resolved with help from service providers like No-IP [11] or DynDNS Service [12]. These providers make it possible to resolve URLs like or to your actual Internet address. The advantage of using DynDNS is that the user does not have to confirm the user account manually every 30 days, as is the case with No-IP. The corresponding access data should be entered into a Fritzbox router under Internet | Permit Access | Dynamic DNS (Figure 7). See the "Minecraft Business" box for more information.

Minecraft Business

A tempest was stirred up last year when Mojang published new user agreements for Minecraft and the Minecraft server. The player and development communities had become concerned about the commercial interest Microsoft was displaying in the little game manufacturer. Then, a Mojang employee issued a tweet declaring that only Mojang was allowed to earn money from the game. At the time, a series of small providers were making good money with services and access to Minecraft servers.

Mojang resolved the confusion on the topic by summarizing the licensing agreements for service operators in a clearly worded blog entry [15]. If the user makes the Minecraft server available free of charge, then there is not much to worry about with the user agreement. A user is permitted to finance outlays for electricity and connectivity with contributions from players. Specifically, you may place ads on the starting page. However, selling items that influence the course of the game is specifically prohibited. By imposing these conditions, Mojang intends to protect itself against fraudulent server operators and also prevent the possibility that players pay money to gain an advantage in a game.

Figure 7: A DynDNS service provider makes it possible for the Minecraft server to be accessed via an address that is easy to remember.

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Learning to program with Minecraft

    No two ways about it: For knowledge to stick, the training must be entertaining. Fortunately, learning to program in Python has just become a lot more fun – now you can learn by playing Minecraft.

  • Don't Use a Hammer

    When you first start building, you probably learn how to use one device and one programming language. Then comes the day you design a project that your toolset either can't solve or forces you to jump through too many hoops to get the outcome you desire. That's the day you start looking at new devices and languages to solve your problem. Having an arsenal of tools at your disposal makes solving problems easier.

  • In with the New

    I am new in the seat of editor-in-chief here at RPG, but I’ve been hanging around in the wings for some time now.

  • Event Report: Pi and More 3

    From all over Germany, Raspberry Pi fans went to Trier in mid-June for "Pi and More 3." For a whole day, visitors of all ages enjoyed lectures and participated in hands-on workshops.

  • Exploring the Kano Kit Pi pack and learning environment

    The Kano Kit learning platform puts the Pi in easy reach for even the youngest users.