How to Run a Minecraft Server on Raspberry Pi
Complete guide to running a Minecraft server on Raspberry Pi, model selection, Java 21 installation, Paper setup, performance tuning, and honest limitations.
Can a Raspberry Pi Actually Run a Minecraft Server?
Yes, with caveats. A minecraft server raspberry pi setup works for small groups of 2–4 players if you choose the right Pi model, the right server software, and tune aggressively. It will never match the performance of a desktop CPU or dedicated hosting, but for a low-cost, low-power, always-on server for friends, a Pi is a surprisingly capable option.
Let's be honest upfront: if you want 10+ players, heavy plugins, or large worlds, a Raspberry Pi is not the right hardware. But for learning server administration, running a small survival server, or just seeing what is possible on a $60 board, read on.
Which Raspberry Pi Model?
| Model | RAM | CPU | Verdict |
|---|---|---|---|
| Pi 5 (8 GB) | 8 GB | Cortex-A76 @ 2.4 GHz | Best option, usable for 3–5 players |
| Pi 5 (4 GB) | 4 GB | Cortex-A76 @ 2.4 GHz | Workable for 2–3 players |
| Pi 4 (8 GB) | 8 GB | Cortex-A72 @ 1.8 GHz | Functional but noticeably slower |
| Pi 4 (4 GB) | 4 GB | Cortex-A72 @ 1.8 GHz | Bare minimum, expect lag with 2+ players |
| Pi 3 or older | 1 GB | Cortex-A53 @ 1.4 GHz | Not recommended, too slow for modern Minecraft |
The Raspberry Pi 5 with 8 GB RAM is the clear winner for a minecraft server raspberry pi project. Its Cortex-A76 cores are roughly 2–3x faster per core than the Pi 4's A72 cores, and Minecraft is heavily single-threaded, so per-core speed matters enormously.
What You Need
- Raspberry Pi 5 (8 GB recommended)
- A quality USB-C power supply (5V/5A for Pi 5, 5V/3A for Pi 4)
- A fast microSD card (A2 rated) or, much better, a USB 3.0 SSD
- An Ethernet cable, do not rely on Wi-Fi for a server
- A case with passive or active cooling, Minecraft keeps the CPU busy
Storage matters. Minecraft servers do heavy random I/O for chunk loading and saving. A USB 3.0 SSD connected to the Pi 5 is 5–10x faster than even a good microSD card and dramatically reduces chunk loading lag. Budget $15–20 for a small SATA SSD + USB adapter.
Installing the OS
Use Raspberry Pi Imager to flash Raspberry Pi OS Lite (64-bit), the headless, no-desktop version. A 64-bit OS is mandatory for Java 21 and gives the JVM access to the full 8 GB of RAM.
Boot the Pi, connect via SSH, and update:
sudo apt update && sudo apt upgrade -y
Installing Java 21
Modern Minecraft (1.20.5+) requires Java 21. On 64-bit Raspberry Pi OS:
sudo apt install openjdk-21-jre-headless -y
java -version
You should see something like openjdk version "21.x.x". If your OS repository does not have Java 21, add the Adoptium repository:
wget -qO, https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo tee /etc/apt/keyrings/adoptium.asc
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(. /etc/os-release && echo $VERSION_CODENAME) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
sudo apt update && sudo apt install temurin-21-jre -y
Installing Paper
Use Paper, not vanilla, not Spigot. Paper includes significant performance optimizations that are critical on ARM hardware. Vanilla Minecraft server is noticeably slower on a Pi.
mkdir -p ~/minecraft && cd ~/minecraft
curl -O https://api.papermc.io/v2/projects/paper/versions/1.21.5/builds/latest/downloads/paper-1.21.5.jar
Create a start script:
cat > start.sh <<'EOF'
#!/bin/bash
java -Xms2G -Xmx3G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:SurvivorRatio=32 -jar paper-1.21.5.jar nogui
EOF
chmod +x start.sh
Allocate 2–3 GB to Minecraft (with -Xmx3G), leaving the rest for the OS and file system cache. On a 4 GB Pi, drop to -Xmx2G. For more JVM flag details, see our JVM flags guide.
Run the server once, accept the EULA, and start again:
./start.sh
# Wait for it to generate files and stop
sed -i 's/eula=false/eula=true/' eula.txt
./start.sh
Performance Tuning, Critical for Pi
Out-of-the-box settings will lag on a Pi. Apply these aggressively in server.properties:
view-distance=6
simulation-distance=4
max-players=5
network-compression-threshold=256
spawn-protection=0
In config/paper-world-defaults.yml, reduce entity activation ranges and mob spawn limits. The Pi's ARM cores cannot handle the default entity processing load at full view distance.
- Set
mob-spawn-rangeto 4 (default is 8). - Reduce
monster-spawn-limitto 40 (default 70). - Set
entity-activation-rangefor monsters to 24, animals to 16, and misc to 8.
Pre-generate your world using Chunky to avoid real-time chunk generation, which is the single most CPU-intensive task for a minecraft server raspberry pi. Pre-generate a 3000-block radius and set a world border to prevent players from exploring beyond it.
Running as a Service
Create a systemd service so the server starts automatically on boot:
sudo tee /etc/systemd/system/minecraft.service >/dev/null <<EOF
[Unit]
Description=Minecraft Server
After=network.target
[Service]
User=pi
WorkingDirectory=/home/pi/minecraft
ExecStart=/home/pi/minecraft/start.sh
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable minecraft
sudo systemctl start minecraft
Check status with sudo systemctl status minecraft and view logs with journalctl -u minecraft -f.
Honest Limitations
A minecraft server raspberry pi will never match a desktop or cloud server. Expect:
- TPS drops to 15–17 during intense activity (mob farms, TNT, large redstone contraptions).
- Chunk generation lag when players explore new terrain, pre-generate to mitigate this.
- Plugin limitations, avoid heavy plugins like Dynmap or Citizens on a Pi. Stick to lightweight essentials.
- No modded server support, Forge and Fabric are too resource-intensive for ARM hardware at this scale.
For anything beyond 4–5 players or if you want a plugin-rich experience, consider upgrading to proper hosting. Compare your options in our home vs cloud hosting guide.
Networking
To let players outside your home network connect, you need to forward port 25565 on your router. Set a static IP for the Pi in your router's DHCP settings (or configure a static IP directly on the Pi) so the forwarding rule does not break when the Pi reboots.
Use a dynamic DNS hostname so players always have a working address, and consider protecting your home IP if you share the server address publicly.
Skip the home server hassle, Astroworld Hosting handles hardware, DDoS protection, and backups so you can focus on your community.