Family Encyclopedia >> Electronics

How to Set Up a Minecraft Server on Your Raspberry Pi: Complete Step-by-Step Guide

Minecraft ranks as the second best-selling video game ever, boasting 122 million online players in September 2019 alone. While solo play has its charms, multiplayer adventures with friends elevate the experience. Hosting your own Minecraft server on a Raspberry Pi gives you complete control: customize rules, add mods, and invite your group to build and explore together.

In this expert guide, drawn from years of hands-on Raspberry Pi projects, I'll walk you through setting up a standalone Minecraft server on your local Wi-Fi network. Perfect for family gaming sessions or kids' playdates, it lets anyone on your network join the fun.

How to Set Up a Minecraft Server on Your Raspberry Pi: Complete Step-by-Step Guide

Ensure You're Running the Latest Raspbian

Boot up your Raspberry Pi and update Raspbian for optimal performance and compatibility. Open a Terminal from the toolbar and run:

sudo apt-get updatesudo apt-get upgrade

Raspbian will fetch and install updates. If prompted, reboot with:

reboot

Update Raspbian's Memory Map

Configure memory allocation for better server handling using the raspi-config tool:

sudo raspi-config

Navigate to "Advanced Options > Memory Allocation," set it to 16, then save with "OK."

Optional: Enable SSH Connections

For remote access, enable SSH:

1. Click the Raspberry Pi icon in the toolbar.
2. Select "Preferences > Raspberry Pi Configuration."

How to Set Up a Minecraft Server on Your Raspberry Pi: Complete Step-by-Step Guide

3. Go to the "Interfaces" tab.
4. Enable "SSH."

How to Set Up a Minecraft Server on Your Raspberry Pi: Complete Step-by-Step Guide

5. Click "OK" to save.
6. Reboot via menu or reboot.

Create a Spigot Server

Spigot offers performance tweaks ideal for Raspberry Pi. First, install Java:

sudo apt install default-jdk

Create the server directory and download BuildTools:

mkdir /home/pi/minecraftcd /home/pi/minecraftwget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar

Build Spigot (using 1.15.2; update --rev for newer versions):

java -Xmx1024M -jar BuildTools.jar --rev 1.15.2

Launch the server:

java -Xms512M -Xmx1008M -jar /home/pi/minecraft/spigot-1.15.2.jar nogui

Accept the EULA: Edit with nano eula.txt, change eula=FALSE to true, save (Ctrl+X, yes, Enter), then reboot.

How to Set Up a Minecraft Server on Your Raspberry Pi: Complete Step-by-Step GuideHow to Set Up a Minecraft Server on Your Raspberry Pi: Complete Step-by-Step Guide

Connect to Your Minecraft Server

Find your Pi's IP:

sudo hostname -I

In Minecraft Java Edition: Play > Multiplayer. It may auto-appear; otherwise, Add Server with the IP.

How to Set Up a Minecraft Server on Your Raspberry Pi: Complete Step-by-Step GuideHow to Set Up a Minecraft Server on Your Raspberry Pi: Complete Step-by-Step GuideHow to Set Up a Minecraft Server on Your Raspberry Pi: Complete Step-by-Step GuideHow to Set Up a Minecraft Server on Your Raspberry Pi: Complete Step-by-Step Guide

Start Your Server Automatically

Create a systemd service for auto-start:

sudo nano /lib/systemd/system/minecraftserver.service

Add:

[Unit]
Description=Minecraft Spigot Server
[Service]
User=pi
Group=pi
Restart=on-abort
WorkingDirectory=/home/pi/minecraft
ExecStart=/usr/bin/java -Xms512M -Xmx1008M -jar /home/pi/minecraft/spigot-1.15.2.jar nogui
[Install]
WantedBy=multi-user.target

Enable and start:

sudo systemctl enable minecraftserver.service
sudo systemctl start minecraftserver.service

Your server now boots automatically. Customize freely and enjoy local play. For external access, set up port forwarding. Share your builds in the comments!