top of page

To create a Minecraft Server on a Raspberry Pi, you first need a Raspberry Pi along with a keyboard and a monitor. The first step is to download Raspian and install it onto the Raspberry Pi. Once Raspbian is set up, it is recommended that it is switched to the command-line interface. Once this is done, run these two commands in the terminal: 

sudo apt update

sudo apt install git build-essential

After these are done type raspi-config into the terminal and navigate to the Advanced Options. Then proceed to select “GL Driver” and hit the Enter Key. Then Select “GL (Fake KMS)”, and hit the Enter key. Finally, select the “Finish” button, hit the Enter Key, and when prompted “Would you like to reboot now?” select “Yes” and hit the Enter Key. 

 Once the Raspberry Pi is back online, install a Java Runtime Environment by running this command: sudo apt install openjdk-8-jre-headless. After this is finished, verify the installation by running the following command: java -version. The output should match this: openjdk version "1.8.0_212"

OpenJDK Runtime Environment (build 1.8.0_212-8u212-b01-1+rpi1-b01)

OpenJDK Client VM (build 25.212-b01, mixed mode)

The next step is to create a user because Minecraft should not run under the root user for security purposes. To create a user, run the following command: sudo useradd -r -m -U -d /opt/minecraft -s /bin/bash minecraft. Finally to install Minecraft onto the Raspberry Pi, make sure the user is “minecraft”, if it is not, run this command: sudo su - minecraft. Once in the Minecraft user, create two directories by running: mkdir -p ~/{tools,server}. Then navigate to the ~/tools directory and clone mcrcon by running: cd ~/tools && git clone https://github.com/Tiiffi/mcrcon.git. Then switch over to the ~/mcrcon repository by running: cd ~/tools/mcrcon. Once in the directory run: gcc -std=gnu11 -pedantic -Wall -Wextra -O2 -s -o mcrcon mcrcon.c. Once this is completed, it can be tested by typing: ./mcrcon -h and the output will look like: 

Usage: mcrcon [OPTIONS]... [COMMANDS]...

Sends rcon commands to Minecraft server.

 

...

 

mcrcon 0.6.1 (built: Sep 19 2019 20:52:13)

Report bugs to tiiffi_at_gmail_dot_com or https://github.com/Tiiffi/mcrcon/issues/

 The last step is to download the minecraft server is to type: cd ~/server. Then run the following command: wget https://launcher.mojang.com/v1/objects/289a247dd42928880769398b049d3890513f2917/server.jar.

Once this is finished, test it by running: java -Xms512M -Xmx768M -jar server.jar nogui. It should stop, so navigate to the eula.txt and open it by running: nano ~/server/eula.txt. Then change false to true and press ctrl+o and enter to close and save the file. Now type: ifconfig, enter and get the ip address. Finally, rerun the server with the same command from earlier, java -Xms512M -Xmx768M -jar server.jar nogui, and your server should run on your Raspberry Pi. To connect to your server, type the ip address of the Raspberry Pi followed by:25565. For example, 190.290.190.20:25565. 

bottom of page